devexpress-richedit 24.1.2-beta → 24.1.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/bin/gulpfile.js +1 -1
- package/bin/index-custom.js +1 -1
- package/bin/localization-builder.js +1 -1
- package/bin/nspell-index.js +1 -1
- package/bin/nspell.webpack.config.js +1 -1
- package/bin/webpack-externals.js +1 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.d.ts +1 -1
- package/dist/dx.richedit.js +259 -200
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/client-rich-edit.js +2 -2
- package/lib/client/public/ribbon/creator.js +1 -0
- package/lib/client/public/ribbon/items/select-box.d.ts +2 -0
- package/lib/client/public/ribbon/items/select-box.js +7 -0
- package/lib/client/public/utils.d.ts +4 -0
- package/lib/client/public/utils.js +15 -0
- package/lib/client/ribbon/i-toolbar-item-options.d.ts +1 -0
- package/lib/common/canvas/canvas-manager.js +1 -1
- package/lib/common/formats/html/export/html-builder.js +8 -4
- package/lib/common/formats/html/export/html-export.d.ts +12 -0
- package/lib/common/formats/html/export/html-export.js +113 -99
- package/lib/common/formats/html/import/html-importer.js +21 -8
- package/lib/common/ui/ruler/controls/divisions.js +2 -1
- package/lib/common/ui/ruler/controls/indent/first-line.js +4 -3
- package/lib/common/ui/ruler/controls/indent/left.js +5 -4
- package/lib/common/ui/ruler/ruler.js +2 -1
- package/package.json +4 -4
package/dist/dx.richedit.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* DevExpress WebRichEdit (dx.richedit.js)
|
3
|
-
* Version: 24.1.
|
3
|
+
* Version: 24.1.3
|
4
4
|
* Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
|
5
5
|
* License: https://www.devexpress.com/Support/EULAs
|
6
6
|
*/
|
@@ -30944,7 +30944,7 @@ function hexToBase64(hexStr) {
|
|
30944
30944
|
return hexadecimal_converter_btoa(result.join(""));
|
30945
30945
|
}
|
30946
30946
|
function base64ToHex(base64Str) {
|
30947
|
-
for (var i = 0, bin =
|
30947
|
+
for (var i = 0, bin = hexadecimal_converter_atob(base64Str.replace(/[ \r\n]+$/, "")), hex = []; i < bin.length; ++i) {
|
30948
30948
|
var tmp = bin.charCodeAt(i).toString(16);
|
30949
30949
|
if (tmp.length === 1)
|
30950
30950
|
tmp = "0" + tmp;
|
@@ -30967,7 +30967,7 @@ function hexadecimal_converter_btoa(bin) {
|
|
30967
30967
|
}
|
30968
30968
|
return base64.join("");
|
30969
30969
|
}
|
30970
|
-
function
|
30970
|
+
function hexadecimal_converter_atob(base64) {
|
30971
30971
|
if (/(=[^=]+|={3,})$/.test(base64))
|
30972
30972
|
throw new Error("String contains an invalid character");
|
30973
30973
|
base64 = base64.replace(/=/g, "");
|
@@ -69744,7 +69744,7 @@ class HtmlImporter {
|
|
69744
69744
|
const missTag = HtmlImporter.MapMissTablePropertiesByTagNames[utils_list.ListUtils.last(this.levelInfo).tagImporter.elementTag()];
|
69745
69745
|
utils_list.ListUtils.forEach(this.currElementChilds, (childElement) => {
|
69746
69746
|
const childElemStyle = this.getStyles(childElement);
|
69747
|
-
if (!childElemStyle)
|
69747
|
+
if (!Object.keys(childElemStyle).length)
|
69748
69748
|
return;
|
69749
69749
|
for (var prop in this.getStyles(element)) {
|
69750
69750
|
if (missTag && /^(border|background|marginLeft)/gi.test(prop))
|
@@ -69756,13 +69756,24 @@ class HtmlImporter {
|
|
69756
69756
|
});
|
69757
69757
|
}
|
69758
69758
|
getStyles(element) {
|
69759
|
-
var _a
|
69760
|
-
|
69761
|
-
|
69762
|
-
|
69763
|
-
|
69764
|
-
|
69765
|
-
|
69759
|
+
var _a;
|
69760
|
+
const styleStr = (_a = element.getAttribute) === null || _a === void 0 ? void 0 : _a.call(element, 'style');
|
69761
|
+
if (!styleStr)
|
69762
|
+
return {};
|
69763
|
+
const urlRegExp = new RegExp('url\\(.*?\\)', 'gi');
|
69764
|
+
const urlKey = '$URL';
|
69765
|
+
const urlValues = styleStr.match(urlRegExp);
|
69766
|
+
return styleStr
|
69767
|
+
.replace(urlRegExp, urlKey)
|
69768
|
+
.split(';')
|
69769
|
+
.reduceRight((res, style) => {
|
69770
|
+
if (!style)
|
69771
|
+
return res;
|
69772
|
+
const colonIndex = style.indexOf(':');
|
69773
|
+
const key = style.substring(0, colonIndex).trim();
|
69774
|
+
const value = style.substring(colonIndex + 1).trim();
|
69775
|
+
res[key] = value === urlKey ? urlValues.pop() : value;
|
69776
|
+
return res;
|
69766
69777
|
}, {});
|
69767
69778
|
}
|
69768
69779
|
addRun(run, forceAdd = false) {
|
@@ -69832,6 +69843,8 @@ class HtmlImporter {
|
|
69832
69843
|
html = html.replace(/<font[^>]*>([^<>]+)<\/font>/gi, '$1');
|
69833
69844
|
html = html.replace(/<span\s*><span\s*>([^<>]+)<\/span><\/span>/ig, '$1');
|
69834
69845
|
html = html.replace(/<span>([^<>]+)<\/span>/gi, '$1');
|
69846
|
+
html = html.replace(/\s*(<li[\S\s]*?>)\s*/gi, '$1');
|
69847
|
+
html = html.replace(/\s*(<\/li>)\s*/gi, '$1');
|
69835
69848
|
html = html.replace(/<li([^>]*)>([^<>]+)<\/li>/gi, '<li$1><p>$2</p></li>');
|
69836
69849
|
html = html.replace(/<li([^>]*)>(([^<>]*)<(?!p)[\s\S]*?)<\/li>/gi, '<li$1><p>$2</p></li>');
|
69837
69850
|
html = html.replace(/<caption([^>]*)>[\s\S]*?<\/caption>/gi, '');
|
@@ -70167,11 +70180,15 @@ class HtmlBuilder {
|
|
70167
70180
|
return this;
|
70168
70181
|
}
|
70169
70182
|
endChild(tagName) {
|
70170
|
-
|
70171
|
-
|
70172
|
-
currentElement
|
70183
|
+
try {
|
70184
|
+
let currentElement = this._currentElement;
|
70185
|
+
while (currentElement.tagName.toLowerCase() !== tagName.toLowerCase())
|
70186
|
+
currentElement = currentElement.parentElement;
|
70187
|
+
this._currentElement = currentElement.parentElement;
|
70188
|
+
}
|
70189
|
+
catch (e) {
|
70190
|
+
console.warn(`The element with the ${tagName} tag is not found.`);
|
70173
70191
|
}
|
70174
|
-
this._currentElement = currentElement.parentElement;
|
70175
70192
|
return this;
|
70176
70193
|
}
|
70177
70194
|
addDefaultMarkup(content) {
|
@@ -70236,47 +70253,8 @@ class HtmlExporter {
|
|
70236
70253
|
let remainLength = interval.length;
|
70237
70254
|
let currentPosition = interval.start;
|
70238
70255
|
let resultBuilder = new HtmlBuilder();
|
70239
|
-
const
|
70240
|
-
const
|
70241
|
-
for (let i = 0, paragraphInInterval; paragraphInInterval = paragraphsInInterval[i]; i++) {
|
70242
|
-
if (interval.containsWithIntervalEnd(paragraphInInterval.getEndPosition()))
|
70243
|
-
paragraphs.push(paragraphInInterval);
|
70244
|
-
}
|
70245
|
-
const listsInInterval = [];
|
70246
|
-
for (let i = 0, paragraph; paragraph = paragraphs[i]; i++) {
|
70247
|
-
if (paragraph.isInList()) {
|
70248
|
-
const paragraphNumberingListIndex = paragraph.getNumberingListIndex();
|
70249
|
-
const paragraphListLevelIndex = paragraph.getListLevelIndex();
|
70250
|
-
const paragraphStart = paragraph.startLogPosition.value;
|
70251
|
-
const paragraphEnd = paragraph.getEndPosition();
|
70252
|
-
let existingItem = null;
|
70253
|
-
for (let j = 0; j < listsInInterval.length; j++) {
|
70254
|
-
if (listsInInterval[j].numberingListIndex == paragraphNumberingListIndex && listsInInterval[j].listLevelIndex == paragraphListLevelIndex)
|
70255
|
-
existingItem = listsInInterval[j];
|
70256
|
-
}
|
70257
|
-
if (existingItem && (paragraphListLevelIndex == 0 || existingItem.end == paragraphStart
|
70258
|
-
|| listsInInterval[listsInInterval.length - 1].listLevelIndex > paragraphListLevelIndex)) {
|
70259
|
-
existingItem.end = paragraphEnd;
|
70260
|
-
}
|
70261
|
-
else {
|
70262
|
-
listsInInterval.push({
|
70263
|
-
numberingListIndex: paragraphNumberingListIndex, listLevelIndex: paragraphListLevelIndex,
|
70264
|
-
start: paragraphStart, end: paragraphEnd
|
70265
|
-
});
|
70266
|
-
}
|
70267
|
-
let listLevelIndex = paragraphListLevelIndex;
|
70268
|
-
while (listLevelIndex > 0) {
|
70269
|
-
let parentItem = null;
|
70270
|
-
for (let j = 0; j < listsInInterval.length; j++) {
|
70271
|
-
if (listsInInterval[j].listLevelIndex == listLevelIndex - 1)
|
70272
|
-
parentItem = listsInInterval[j];
|
70273
|
-
}
|
70274
|
-
if (parentItem)
|
70275
|
-
parentItem.end = paragraphEnd;
|
70276
|
-
listLevelIndex--;
|
70277
|
-
}
|
70278
|
-
}
|
70279
|
-
}
|
70256
|
+
const paragraphs = this.getParagraphsByInterval(subDocument, interval);
|
70257
|
+
const lists = this.getListsByParagraphs(paragraphs);
|
70280
70258
|
let isInsideFieldCode = false;
|
70281
70259
|
let fieldDeep = 0;
|
70282
70260
|
let isInsideHyperlink = false;
|
@@ -70286,53 +70264,6 @@ class HtmlExporter {
|
|
70286
70264
|
while (iterator.moveNext()) {
|
70287
70265
|
const tableCell = Table.getTableCellByPosition(subDocument.tables, iterator.currentInterval().start);
|
70288
70266
|
const isContinueMergingCell = tableCell && tableCell.verticalMerging === TableCellMergingState.Continue;
|
70289
|
-
let listToStartIndex = -1;
|
70290
|
-
const listsToEndIndices = [];
|
70291
|
-
if (!tableCell) {
|
70292
|
-
if (listsInInterval.length) {
|
70293
|
-
const currentPosition = iterator.currentInterval().start;
|
70294
|
-
for (let i = 0; i < listsInInterval.length; i++) {
|
70295
|
-
if (listsInInterval[i].start == currentPosition)
|
70296
|
-
listToStartIndex = i;
|
70297
|
-
if (listsInInterval[i].end == iterator.currentInterval().end)
|
70298
|
-
listsToEndIndices.push(i);
|
70299
|
-
}
|
70300
|
-
if (listToStartIndex < 0 && currentPosition == interval.start) {
|
70301
|
-
const firstParagraph = subDocument.getParagraphByPosition(currentPosition);
|
70302
|
-
if (firstParagraph.getNumberingListIndex() == listsInInterval[0].numberingListIndex)
|
70303
|
-
listToStartIndex = 0;
|
70304
|
-
}
|
70305
|
-
}
|
70306
|
-
if (listToStartIndex > -1) {
|
70307
|
-
const numberingList = model.numberingLists[listsInInterval[listToStartIndex].numberingListIndex];
|
70308
|
-
let listFormatType = "";
|
70309
|
-
switch (numberingList.levels[listsInInterval[listToStartIndex].listLevelIndex].getListLevelProperties().format) {
|
70310
|
-
case NumberingFormat.Bullet:
|
70311
|
-
listFormatType = "disc";
|
70312
|
-
break;
|
70313
|
-
case NumberingFormat.Decimal:
|
70314
|
-
listFormatType = "decimal";
|
70315
|
-
break;
|
70316
|
-
case NumberingFormat.LowerLetter:
|
70317
|
-
listFormatType = "lower-alpha";
|
70318
|
-
break;
|
70319
|
-
case NumberingFormat.UpperLetter:
|
70320
|
-
listFormatType = "upper-alpha";
|
70321
|
-
break;
|
70322
|
-
case NumberingFormat.LowerRoman:
|
70323
|
-
listFormatType = "lower-roman";
|
70324
|
-
break;
|
70325
|
-
case NumberingFormat.UpperRoman:
|
70326
|
-
listFormatType = "upper-roman";
|
70327
|
-
break;
|
70328
|
-
default:
|
70329
|
-
break;
|
70330
|
-
}
|
70331
|
-
resultBuilder
|
70332
|
-
.startChild(numberingList.getListType() != numbering_list_NumberingType.Bullet ? "ol" : "ul")
|
70333
|
-
.configure((e) => e.style.cssText = "list-style-type:" + listFormatType);
|
70334
|
-
}
|
70335
|
-
}
|
70336
70267
|
const run = iterator.currentRun;
|
70337
70268
|
const isRunInEmptyParagraph = run.paragraph.length === 1;
|
70338
70269
|
if (paragraphs.length && (run.getType() != RunType.ParagraphRun || isRunInEmptyParagraph)) {
|
@@ -70403,6 +70334,7 @@ class HtmlExporter {
|
|
70403
70334
|
});
|
70404
70335
|
}
|
70405
70336
|
}
|
70337
|
+
this.startList(model, subDocument, interval, resultBuilder, lists, iterator.currentInterval().start);
|
70406
70338
|
if (!isContinueMergingCell) {
|
70407
70339
|
const maskedParagraphProperties = currentParagraph.getParagraphMergedProperties();
|
70408
70340
|
let paragraphStyle = "";
|
@@ -70483,17 +70415,15 @@ class HtmlExporter {
|
|
70483
70415
|
paragraphStyle += HtmlConverter.getCssRules(charProps, charProps.textColor.toRgb(this.colorProvider), false, false, false)
|
70484
70416
|
.join(";");
|
70485
70417
|
}
|
70486
|
-
if (currentParagraph.isInList()
|
70418
|
+
if (currentParagraph.isInList())
|
70487
70419
|
resultBuilder.startChild('li');
|
70488
70420
|
resultBuilder
|
70489
70421
|
.startChild('p')
|
70490
70422
|
.configure((e) => {
|
70491
|
-
if (paragraphStyle)
|
70423
|
+
if (paragraphStyle)
|
70492
70424
|
e.style.cssText = paragraphStyle;
|
70493
|
-
|
70494
|
-
if (isRunInEmptyParagraph) {
|
70425
|
+
if (isRunInEmptyParagraph)
|
70495
70426
|
e.innerHTML = " ";
|
70496
|
-
}
|
70497
70427
|
});
|
70498
70428
|
}
|
70499
70429
|
}
|
@@ -70505,6 +70435,10 @@ class HtmlExporter {
|
|
70505
70435
|
case RunType.ParagraphRun:
|
70506
70436
|
if (!isContinueMergingCell) {
|
70507
70437
|
html.addCallback((builder) => builder.endChild('p'));
|
70438
|
+
if (run.paragraph.isInList()) {
|
70439
|
+
html.addCallback((builder) => builder.endChild('li'));
|
70440
|
+
html.addCallback((builder) => this.endList(model, builder, lists, iterator.currentInterval().end));
|
70441
|
+
}
|
70508
70442
|
let paragraphEndPosition = run.paragraph.getEndPosition();
|
70509
70443
|
if (tableCell) {
|
70510
70444
|
let parentRow = tableCell.parentRow;
|
@@ -70682,10 +70616,6 @@ class HtmlExporter {
|
|
70682
70616
|
}
|
70683
70617
|
}
|
70684
70618
|
resultBuilder.assignFrom(html);
|
70685
|
-
if (listsToEndIndices.length) {
|
70686
|
-
for (let i = listsToEndIndices.length - 1; i >= 0; i--)
|
70687
|
-
resultBuilder.endChild(model.numberingLists[listsInInterval[listsToEndIndices[i]].numberingListIndex].getListType() != numbering_list_NumberingType.Bullet ? "ol" : "ul");
|
70688
|
-
}
|
70689
70619
|
currentPosition += length;
|
70690
70620
|
remainLength -= length;
|
70691
70621
|
}
|
@@ -70722,6 +70652,57 @@ class HtmlExporter {
|
|
70722
70652
|
.endChild('span');
|
70723
70653
|
return resultBuilder;
|
70724
70654
|
}
|
70655
|
+
getParagraphsByInterval(subDocument, interval) {
|
70656
|
+
const paragraphsInInterval = subDocument.getParagraphsByInterval(interval);
|
70657
|
+
const paragraphs = [];
|
70658
|
+
for (let i = 0, paragraphInInterval; paragraphInInterval = paragraphsInInterval[i]; i++) {
|
70659
|
+
if (interval.containsWithIntervalEnd(paragraphInInterval.getEndPosition()))
|
70660
|
+
paragraphs.push(paragraphInInterval);
|
70661
|
+
}
|
70662
|
+
return paragraphs;
|
70663
|
+
}
|
70664
|
+
getListsByParagraphs(paragraphs) {
|
70665
|
+
const listsInInterval = [];
|
70666
|
+
for (let i = 0, paragraph; paragraph = paragraphs[i]; i++) {
|
70667
|
+
if (paragraph.isInList()) {
|
70668
|
+
const paragraphNumberingListIndex = paragraph.getNumberingListIndex();
|
70669
|
+
const paragraphListLevelIndex = paragraph.getListLevelIndex();
|
70670
|
+
const paragraphStart = paragraph.startLogPosition.value;
|
70671
|
+
const paragraphEnd = paragraph.getEndPosition();
|
70672
|
+
let existingItem = null;
|
70673
|
+
for (let j = 0; j < listsInInterval.length; j++) {
|
70674
|
+
if (listsInInterval[j].numberingListIndex === paragraphNumberingListIndex
|
70675
|
+
&& listsInInterval[j].listLevelIndex === paragraphListLevelIndex) {
|
70676
|
+
existingItem = listsInInterval[j];
|
70677
|
+
}
|
70678
|
+
}
|
70679
|
+
if (existingItem && (paragraphListLevelIndex === 0 || existingItem.end == paragraphStart
|
70680
|
+
|| listsInInterval[listsInInterval.length - 1].listLevelIndex > paragraphListLevelIndex)) {
|
70681
|
+
existingItem.end = paragraphEnd;
|
70682
|
+
}
|
70683
|
+
else {
|
70684
|
+
listsInInterval.push({
|
70685
|
+
numberingListIndex: paragraphNumberingListIndex,
|
70686
|
+
listLevelIndex: paragraphListLevelIndex,
|
70687
|
+
start: paragraphStart,
|
70688
|
+
end: paragraphEnd,
|
70689
|
+
});
|
70690
|
+
}
|
70691
|
+
let listLevelIndex = paragraphListLevelIndex;
|
70692
|
+
while (listLevelIndex > 0) {
|
70693
|
+
let parentItem = null;
|
70694
|
+
for (let j = 0; j < listsInInterval.length; j++) {
|
70695
|
+
if (listsInInterval[j].listLevelIndex == listLevelIndex - 1)
|
70696
|
+
parentItem = listsInInterval[j];
|
70697
|
+
}
|
70698
|
+
if (parentItem)
|
70699
|
+
parentItem.end = paragraphEnd;
|
70700
|
+
listLevelIndex--;
|
70701
|
+
}
|
70702
|
+
}
|
70703
|
+
}
|
70704
|
+
return listsInInterval;
|
70705
|
+
}
|
70725
70706
|
addParentTableRecursively(model, builder, parentCell, paragraphStartPosition) {
|
70726
70707
|
const parentRow = parentCell.parentRow;
|
70727
70708
|
const parentTable = parentRow.parentTable;
|
@@ -70739,9 +70720,9 @@ class HtmlExporter {
|
|
70739
70720
|
builder
|
70740
70721
|
.startChild('td')
|
70741
70722
|
.configure(el => {
|
70742
|
-
el.style.cssText =
|
70723
|
+
el.style.cssText = 'mso-cell-special:placeholder';
|
70743
70724
|
el.setAttribute('colspan', parentRow.gridBefore.toString());
|
70744
|
-
el.innerHTML =
|
70725
|
+
el.innerHTML = ' ';
|
70745
70726
|
})
|
70746
70727
|
.endChild('td');
|
70747
70728
|
}
|
@@ -70756,6 +70737,56 @@ class HtmlExporter {
|
|
70756
70737
|
});
|
70757
70738
|
}
|
70758
70739
|
}
|
70740
|
+
startList(model, subDocument, interval, builder, lists, position) {
|
70741
|
+
if (!lists.length)
|
70742
|
+
return;
|
70743
|
+
let listIndex = lists.findIndex((list) => list.start === position);
|
70744
|
+
if (listIndex < 0 && position === interval.start) {
|
70745
|
+
const firstParagraph = subDocument.getParagraphByPosition(position);
|
70746
|
+
if (firstParagraph.getNumberingListIndex() === lists[0].numberingListIndex)
|
70747
|
+
listIndex = 0;
|
70748
|
+
}
|
70749
|
+
if (listIndex > -1) {
|
70750
|
+
const numberingList = model.numberingLists[lists[listIndex].numberingListIndex];
|
70751
|
+
const numberingListFormat = numberingList.levels[lists[listIndex].listLevelIndex].getListLevelProperties().format;
|
70752
|
+
const numberingListType = numberingList.getListType();
|
70753
|
+
let listFormatType = "";
|
70754
|
+
switch (numberingListFormat) {
|
70755
|
+
case NumberingFormat.Bullet:
|
70756
|
+
listFormatType = "disc";
|
70757
|
+
break;
|
70758
|
+
case NumberingFormat.Decimal:
|
70759
|
+
listFormatType = "decimal";
|
70760
|
+
break;
|
70761
|
+
case NumberingFormat.LowerLetter:
|
70762
|
+
listFormatType = "lower-alpha";
|
70763
|
+
break;
|
70764
|
+
case NumberingFormat.UpperLetter:
|
70765
|
+
listFormatType = "upper-alpha";
|
70766
|
+
break;
|
70767
|
+
case NumberingFormat.LowerRoman:
|
70768
|
+
listFormatType = "lower-roman";
|
70769
|
+
break;
|
70770
|
+
case NumberingFormat.UpperRoman:
|
70771
|
+
listFormatType = "upper-roman";
|
70772
|
+
break;
|
70773
|
+
default:
|
70774
|
+
break;
|
70775
|
+
}
|
70776
|
+
builder
|
70777
|
+
.startChild(numberingListType !== numbering_list_NumberingType.Bullet ? "ol" : "ul")
|
70778
|
+
.configure((e) => e.style.cssText = "list-style-type:" + listFormatType);
|
70779
|
+
}
|
70780
|
+
}
|
70781
|
+
endList(model, builder, lists, endPosition) {
|
70782
|
+
for (let i = lists.length - 1; i >= 0; i--) {
|
70783
|
+
if (lists[i].end === endPosition) {
|
70784
|
+
const listType = model.numberingLists[lists[i].numberingListIndex].getListType();
|
70785
|
+
lists.splice(i, 1);
|
70786
|
+
builder.endChild(listType != numbering_list_NumberingType.Bullet ? "ol" : "ul");
|
70787
|
+
}
|
70788
|
+
}
|
70789
|
+
}
|
70759
70790
|
getHtmlText(text) {
|
70760
70791
|
const result = new HtmlBuilder();
|
70761
70792
|
for (let i = 0; i < text.length; i++) {
|
@@ -109844,7 +109875,7 @@ class CanvasManager extends batch_updatable/* BatchUpdatableObject */.IS {
|
|
109844
109875
|
dom.DomUtils.removeClassName(this.viewManager.canvas, CSSCLASS_FOCUSED);
|
109845
109876
|
}
|
109846
109877
|
getCanvasWidth() {
|
109847
|
-
return SizeUtils.
|
109878
|
+
return SizeUtils.getClientWidth(this.viewManager.canvas);
|
109848
109879
|
}
|
109849
109880
|
onCanvasMouseWheel(evt) {
|
109850
109881
|
if (!this.viewManager.layout)
|
@@ -114615,6 +114646,7 @@ class RulerBase {
|
|
114615
114646
|
|
114616
114647
|
|
114617
114648
|
|
114649
|
+
|
114618
114650
|
const MINOR_TOP_AND_BOTTOM_MARGIN = 4;
|
114619
114651
|
const MAJOR_TOP_AND_BOTTOM_MARGIN = 2;
|
114620
114652
|
const DIVISION_CONTAINER_CLASS_NAME = RULER_CLASS_NAME + "Divisions";
|
@@ -114631,7 +114663,7 @@ class RulerDivisionsControl extends RulerBase {
|
|
114631
114663
|
this.controls.ruler.rootElement.appendChild(this.rootElement);
|
114632
114664
|
if (browser.Browser.IE && browser.Browser.MajorVersion <= 9)
|
114633
114665
|
this.rootElement.offsetParent;
|
114634
|
-
this.height = this.rootElement
|
114666
|
+
this.height = SizeUtils.getOffsetHeight(this.rootElement);
|
114635
114667
|
createDivisionElements(this.rootElement, unitCount, divisionInfo, this.height);
|
114636
114668
|
this.initialLeft = -(unitCount * divisionInfo.unitSize - RULLER_NUMBER_CORRECTION);
|
114637
114669
|
}
|
@@ -114881,6 +114913,7 @@ class RulerBaseIndentControl extends RulerBase {
|
|
114881
114913
|
|
114882
114914
|
|
114883
114915
|
|
114916
|
+
|
114884
114917
|
class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
|
114885
114918
|
constructor(modelData, controls) {
|
114886
114919
|
super(modelData, controls);
|
@@ -114890,8 +114923,8 @@ class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
|
|
114890
114923
|
this.rootElement.title = this.modelData.settings.titles.firstLineIndent;
|
114891
114924
|
this.controls.ruler.rootElement.appendChild(this.rootElement);
|
114892
114925
|
this.adjustByTop();
|
114893
|
-
this.leftCorrection = Math.round(this.rootElement
|
114894
|
-
this._heightOfProtrudingPart = this.rootElement
|
114926
|
+
this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
|
114927
|
+
this._heightOfProtrudingPart = SizeUtils.getOffsetHeight(this.rootElement) - this.controls.divisions.height / 2;
|
114895
114928
|
}
|
114896
114929
|
get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
|
114897
114930
|
getRootClassName() {
|
@@ -114899,7 +114932,7 @@ class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
|
|
114899
114932
|
this.modelData.settings.styles.firstLineIndent.className;
|
114900
114933
|
}
|
114901
114934
|
adjustByTop() {
|
114902
|
-
const mainElementHeight = this.rootElement
|
114935
|
+
const mainElementHeight = SizeUtils.getOffsetHeight(this.rootElement);
|
114903
114936
|
const divisionsControlHeight = this.controls.divisions.height;
|
114904
114937
|
this.rootElement.style.marginTop = (mainElementHeight - divisionsControlHeight) / 2 + "px";
|
114905
114938
|
}
|
@@ -114941,6 +114974,7 @@ class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
|
|
114941
114974
|
|
114942
114975
|
|
114943
114976
|
|
114977
|
+
|
114944
114978
|
const LEFT_INDENT_DRAG_HANDLE_BODY = RICH_EDIT_CLASS_NAME_PREFIX + "leftIndentDragHandleBody";
|
114945
114979
|
class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
|
114946
114980
|
constructor(modelData, controls) {
|
@@ -114961,18 +114995,18 @@ class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
|
|
114961
114995
|
const mainElementWidth = this.topElement.offsetWidth;
|
114962
114996
|
this.bodyElement.style.width = mainElementWidth + "px";
|
114963
114997
|
const style = this.rootElement.style;
|
114964
|
-
style.height = this.topElement
|
114998
|
+
style.height = SizeUtils.getOffsetHeight(this.topElement) + SizeUtils.getOffsetHeight(this.bodyElement) + "px";
|
114965
114999
|
style.width = mainElementWidth + "px";
|
114966
115000
|
style.marginTop = this.controls.divisions.height / 2 + "px";
|
114967
115001
|
this.bodyElement.title = this.modelData.settings.titles.leftIndent;
|
114968
115002
|
this.topElement.title = this.modelData.settings.titles.hangingIndent;
|
114969
|
-
this.leftCorrection = Math.round(this.rootElement
|
114970
|
-
this._heightOfProtrudingPart = this.rootElement
|
115003
|
+
this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
|
115004
|
+
this._heightOfProtrudingPart = SizeUtils.getOffsetHeight(this.rootElement) - this.controls.divisions.height / 2;
|
114971
115005
|
}
|
114972
115006
|
get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
|
114973
115007
|
getRootClassName() { return this.modelData.settings.styles.leftIndent.className; }
|
114974
115008
|
adjustByTop() {
|
114975
|
-
const mainElementHeight = this.rootElement
|
115009
|
+
const mainElementHeight = SizeUtils.getOffsetHeight(this.rootElement);
|
114976
115010
|
const divisionsControlHeight = this.controls.divisions.height;
|
114977
115011
|
this.rootElement.style.marginTop = (mainElementHeight - divisionsControlHeight) / 2 + "px";
|
114978
115012
|
}
|
@@ -116807,6 +116841,7 @@ class RulerModelData {
|
|
116807
116841
|
|
116808
116842
|
|
116809
116843
|
|
116844
|
+
|
116810
116845
|
var HorizontalRulerEventType;
|
116811
116846
|
(function (HorizontalRulerEventType) {
|
116812
116847
|
HorizontalRulerEventType[HorizontalRulerEventType["None"] = 0] = "None";
|
@@ -116993,7 +117028,7 @@ class HorizontalRulerControl extends batch_updatable/* BatchUpdatableObject */.I
|
|
116993
117028
|
return this._visible;
|
116994
117029
|
}
|
116995
117030
|
getHeight() {
|
116996
|
-
return this.initialized ? this.controls.wrapper.rootElement
|
117031
|
+
return this.initialized ? SizeUtils.getOffsetHeight(this.controls.wrapper.rootElement) : 0;
|
116997
117032
|
}
|
116998
117033
|
onViewTypeChanged() {
|
116999
117034
|
this.innerSetVisible(this._visible && !this.modelData.innerClientProperties.viewsSettings.isSimpleView);
|
@@ -123925,10 +123960,100 @@ class RibbonNumberBoxItem extends RibbonItemBase {
|
|
123925
123960
|
}
|
123926
123961
|
}
|
123927
123962
|
|
123963
|
+
;// CONCATENATED MODULE: ./src/client/public/utils.ts
|
123964
|
+
|
123965
|
+
|
123966
|
+
|
123967
|
+
|
123968
|
+
|
123969
|
+
|
123970
|
+
|
123971
|
+
|
123972
|
+
|
123973
|
+
class FilePathInfo {
|
123974
|
+
constructor(filePath) {
|
123975
|
+
this.path = filePath.replace(/\\/g, '/');
|
123976
|
+
this.documentFormat = Utils.getDocumentFormat(this.path);
|
123977
|
+
this.extension = this.documentFormat === null ? '' : Utils.documentFormatToExtension(this.documentFormat);
|
123978
|
+
const index = this.path.lastIndexOf('/');
|
123979
|
+
if (index >= 0) {
|
123980
|
+
this.directoryPath = this.path.substring(0, index);
|
123981
|
+
this.name = this.path.substring(index + 1);
|
123982
|
+
}
|
123983
|
+
else {
|
123984
|
+
this.directoryPath = "";
|
123985
|
+
this.name = this.path;
|
123986
|
+
}
|
123987
|
+
this.nameWithoutExtension = this.name.substring(0, this.name.length - this.extension.length);
|
123988
|
+
}
|
123989
|
+
}
|
123990
|
+
class Utils {
|
123991
|
+
static download(content, fileName) {
|
123992
|
+
utils_file.FileUtils.startDownloadFileLocal(content, fileName);
|
123993
|
+
}
|
123994
|
+
static parseFilePath(filePath) {
|
123995
|
+
return new FilePathInfo(filePath);
|
123996
|
+
}
|
123997
|
+
static documentFormatToExtension(documentFormat) {
|
123998
|
+
return FileNameHelper.convertToString(documentFormat);
|
123999
|
+
}
|
124000
|
+
static getDocumentFormat(filePath) {
|
124001
|
+
const pointIndex = filePath.lastIndexOf('.');
|
124002
|
+
const extenion = pointIndex >= 0 ? filePath.substr(pointIndex) : filePath;
|
124003
|
+
const coreDocFormat = FileNameHelper.convertExtensionToDocumentFormat(extenion);
|
124004
|
+
return coreDocFormat === DocumentFormat.Undefined ? null : coreDocFormat;
|
124005
|
+
}
|
124006
|
+
static convertArrayBufferToBase64(content) {
|
124007
|
+
return utils_base64.Base64Utils.fromArrayBuffer(content);
|
124008
|
+
}
|
124009
|
+
static convertBlobToBase64(content, callback) {
|
124010
|
+
utils_base64.Base64Utils.fromBlobAsDataUrl(content, callback);
|
124011
|
+
}
|
124012
|
+
static convertToBlob(content, options) {
|
124013
|
+
return (0,common.isString)(content) ?
|
124014
|
+
new Blob([utils_base64.Base64Utils.getUint8Array(content)], options) :
|
124015
|
+
new Blob([content], options);
|
124016
|
+
}
|
124017
|
+
static convertToFile(content, fileName = '', options) {
|
124018
|
+
return (0,common.isString)(content) ?
|
124019
|
+
utils_base64.Base64Utils.getFileFromBase64(utils_base64.Base64Utils.deleteDataUrlPrefix(content), fileName, options) :
|
124020
|
+
utils_file.FileUtils.createFile([content], fileName, options);
|
124021
|
+
}
|
124022
|
+
static convertBase64ToArrayBuffer(content) {
|
124023
|
+
return utils_base64.Base64Utils.getUint8Array(content);
|
124024
|
+
}
|
124025
|
+
static convertBlobToArrayBuffer(content, callback) {
|
124026
|
+
const reader = new FileReader();
|
124027
|
+
reader.onloadend = () => callback(reader.result);
|
124028
|
+
reader.readAsArrayBuffer(content);
|
124029
|
+
}
|
124030
|
+
static getIntervalComplement(bound, intervals) {
|
124031
|
+
const apiIntervals = utils_list.ListUtils.map(intervals, curr => convertFromIntervalApi(curr));
|
124032
|
+
const coreResult = algorithms.IntervalAlgorithms.reflectIntervalsTemplate(apiIntervals, convertFromIntervalApi(bound), new fixed.FixedInterval(0, 0));
|
124033
|
+
return utils_list.ListUtils.map(coreResult, curr => convertToIntervalApi(curr));
|
124034
|
+
}
|
124035
|
+
}
|
124036
|
+
class TypeConverterFactory {
|
124037
|
+
static create(valueType) {
|
124038
|
+
const converter = this.createCore(valueType);
|
124039
|
+
return converter ? text => { var _a; return (_a = converter(text)) !== null && _a !== void 0 ? _a : text; } : null;
|
124040
|
+
}
|
124041
|
+
static createCore(valueType) {
|
124042
|
+
const strType = valueType.toLowerCase();
|
124043
|
+
switch (strType) {
|
124044
|
+
case 'number':
|
124045
|
+
return text => parseFloat(text);
|
124046
|
+
default:
|
124047
|
+
return null;
|
124048
|
+
}
|
124049
|
+
}
|
124050
|
+
}
|
124051
|
+
|
123928
124052
|
;// CONCATENATED MODULE: ./src/client/public/ribbon/items/select-box.ts
|
123929
124053
|
|
123930
124054
|
|
123931
124055
|
|
124056
|
+
|
123932
124057
|
class RibbonSelectBoxItem extends RibbonItemBase {
|
123933
124058
|
constructor(id, dataSource, options = {}) {
|
123934
124059
|
var _a;
|
@@ -123939,12 +124064,18 @@ class RibbonSelectBoxItem extends RibbonItemBase {
|
|
123939
124064
|
this.displayExpr = options.displayExpr;
|
123940
124065
|
this.valueExpr = options.valueExpr;
|
123941
124066
|
this.value = options.value;
|
124067
|
+
this.valueType = options.valueType;
|
123942
124068
|
this._localizeDataSourceItems = options._localizeDataSourceItems === undefined ? false : options._localizeDataSourceItems;
|
123943
124069
|
this.textOptions = (_a = options.textOptions) !== null && _a !== void 0 ? _a : {};
|
123944
124070
|
this.showClearButton = options.showClearButton === undefined ? false : options.showClearButton;
|
123945
124071
|
this.placeholder = options.placeholder;
|
123946
124072
|
this.acceptCustomValue = (0,common.isDefined)(options.acceptCustomValue) ? options.acceptCustomValue : false;
|
123947
124073
|
this.onCustomItemCreating = options.onCustomItemCreating ? (0,utils/* convertToFunction */.tm)(options.onCustomItemCreating) : undefined;
|
124074
|
+
if (!this.onCustomItemCreating && this.valueType) {
|
124075
|
+
const converter = TypeConverterFactory.create(this.valueType);
|
124076
|
+
if (converter)
|
124077
|
+
this.onCustomItemCreating = (e) => e.customItem = { text: e.text, value: converter(e.text) };
|
124078
|
+
}
|
123948
124079
|
}
|
123949
124080
|
}
|
123950
124081
|
|
@@ -124092,6 +124223,7 @@ function createItems(rawItems) {
|
|
124092
124223
|
displayExpr: rawItem.displayExpr,
|
124093
124224
|
valueExpr: rawItem.valueExpr,
|
124094
124225
|
value: rawItem.value,
|
124226
|
+
valueType: rawItem.valueType,
|
124095
124227
|
showClearButton: rawItem.showClearButton,
|
124096
124228
|
placeholder: rawItem.placeholder,
|
124097
124229
|
acceptCustomValue: rawItem.acceptCustomValue,
|
@@ -143435,6 +143567,7 @@ class FullScreenHelper {
|
|
143435
143567
|
|
143436
143568
|
;// CONCATENATED MODULE: external "DevExpress.config"
|
143437
143569
|
var external_DevExpress_config_namespaceObject = DevExpress.config;
|
143570
|
+
var external_DevExpress_config_default = /*#__PURE__*/__webpack_require__.n(external_DevExpress_config_namespaceObject);
|
143438
143571
|
;// CONCATENATED MODULE: ./src/client/client-rich-edit.ts
|
143439
143572
|
|
143440
143573
|
|
@@ -143491,8 +143624,8 @@ class ClientRichEdit {
|
|
143491
143624
|
this.rawDataSource = settings.rawDataSource;
|
143492
143625
|
this.contextMenuSettings = settings.contextMenuSettings;
|
143493
143626
|
this.fullScreenHelper = new FullScreenHelper(element);
|
143494
|
-
if (
|
143495
|
-
|
143627
|
+
if (true)
|
143628
|
+
external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWFUbHhVemQxYzBSQ01HVlpTbDlrVGkxb2FYaGtVU0lLZlE9PS5INTlJcG94ZC90cWdVcE1leVdhamhubjl2NnFtMkFrQmc2MW0yU05ZUHIreFBrdnRLUm04Wm4rU08rUVQ3NEt3MVpWQ0pGeEJYV1dJRlNyRG1EZlVqYmV6N2RzTnpJbTR6S1A5M2l4amVQR0Jnb2o4eG9VSmZvNldmZzNMblpTUlNLcHFpZz09In0=')));
|
143496
143629
|
this.prepareElement(element, settings);
|
143497
143630
|
this.initDefaultFontsAndStyles();
|
143498
143631
|
this.initBars(settings.ribbon, settings.fonts);
|
@@ -145771,80 +145904,6 @@ function addAttribute(element, name, value) {
|
|
145771
145904
|
element.setAttribute(name, value);
|
145772
145905
|
}
|
145773
145906
|
|
145774
|
-
;// CONCATENATED MODULE: ./src/client/public/utils.ts
|
145775
|
-
|
145776
|
-
|
145777
|
-
|
145778
|
-
|
145779
|
-
|
145780
|
-
|
145781
|
-
|
145782
|
-
|
145783
|
-
|
145784
|
-
class FilePathInfo {
|
145785
|
-
constructor(filePath) {
|
145786
|
-
this.path = filePath.replace(/\\/g, '/');
|
145787
|
-
this.documentFormat = Utils.getDocumentFormat(this.path);
|
145788
|
-
this.extension = this.documentFormat === null ? '' : Utils.documentFormatToExtension(this.documentFormat);
|
145789
|
-
const index = this.path.lastIndexOf('/');
|
145790
|
-
if (index >= 0) {
|
145791
|
-
this.directoryPath = this.path.substring(0, index);
|
145792
|
-
this.name = this.path.substring(index + 1);
|
145793
|
-
}
|
145794
|
-
else {
|
145795
|
-
this.directoryPath = "";
|
145796
|
-
this.name = this.path;
|
145797
|
-
}
|
145798
|
-
this.nameWithoutExtension = this.name.substring(0, this.name.length - this.extension.length);
|
145799
|
-
}
|
145800
|
-
}
|
145801
|
-
class Utils {
|
145802
|
-
static download(content, fileName) {
|
145803
|
-
utils_file.FileUtils.startDownloadFileLocal(content, fileName);
|
145804
|
-
}
|
145805
|
-
static parseFilePath(filePath) {
|
145806
|
-
return new FilePathInfo(filePath);
|
145807
|
-
}
|
145808
|
-
static documentFormatToExtension(documentFormat) {
|
145809
|
-
return FileNameHelper.convertToString(documentFormat);
|
145810
|
-
}
|
145811
|
-
static getDocumentFormat(filePath) {
|
145812
|
-
const pointIndex = filePath.lastIndexOf('.');
|
145813
|
-
const extenion = pointIndex >= 0 ? filePath.substr(pointIndex) : filePath;
|
145814
|
-
const coreDocFormat = FileNameHelper.convertExtensionToDocumentFormat(extenion);
|
145815
|
-
return coreDocFormat === DocumentFormat.Undefined ? null : coreDocFormat;
|
145816
|
-
}
|
145817
|
-
static convertArrayBufferToBase64(content) {
|
145818
|
-
return utils_base64.Base64Utils.fromArrayBuffer(content);
|
145819
|
-
}
|
145820
|
-
static convertBlobToBase64(content, callback) {
|
145821
|
-
utils_base64.Base64Utils.fromBlobAsDataUrl(content, callback);
|
145822
|
-
}
|
145823
|
-
static convertToBlob(content, options) {
|
145824
|
-
return (0,common.isString)(content) ?
|
145825
|
-
new Blob([utils_base64.Base64Utils.getUint8Array(content)], options) :
|
145826
|
-
new Blob([content], options);
|
145827
|
-
}
|
145828
|
-
static convertToFile(content, fileName = '', options) {
|
145829
|
-
return (0,common.isString)(content) ?
|
145830
|
-
utils_base64.Base64Utils.getFileFromBase64(utils_base64.Base64Utils.deleteDataUrlPrefix(content), fileName, options) :
|
145831
|
-
utils_file.FileUtils.createFile([content], fileName, options);
|
145832
|
-
}
|
145833
|
-
static convertBase64ToArrayBuffer(content) {
|
145834
|
-
return utils_base64.Base64Utils.getUint8Array(content);
|
145835
|
-
}
|
145836
|
-
static convertBlobToArrayBuffer(content, callback) {
|
145837
|
-
const reader = new FileReader();
|
145838
|
-
reader.onloadend = () => callback(reader.result);
|
145839
|
-
reader.readAsArrayBuffer(content);
|
145840
|
-
}
|
145841
|
-
static getIntervalComplement(bound, intervals) {
|
145842
|
-
const apiIntervals = utils_list.ListUtils.map(intervals, curr => convertFromIntervalApi(curr));
|
145843
|
-
const coreResult = algorithms.IntervalAlgorithms.reflectIntervalsTemplate(apiIntervals, convertFromIntervalApi(bound), new fixed.FixedInterval(0, 0));
|
145844
|
-
return utils_list.ListUtils.map(coreResult, curr => convertToIntervalApi(curr));
|
145845
|
-
}
|
145846
|
-
}
|
145847
|
-
|
145848
145907
|
;// CONCATENATED MODULE: external "DevExpress.trial"
|
145849
145908
|
var external_DevExpress_trial_namespaceObject = DevExpress.trial;
|
145850
145909
|
var external_DevExpress_trial_default = /*#__PURE__*/__webpack_require__.n(external_DevExpress_trial_namespaceObject);
|