devexpress-richedit 24.1.1-alpha-24085-0102 → 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.
Files changed (210) hide show
  1. package/bin/gulpfile.js +1 -1
  2. package/bin/index-custom.js +1 -1
  3. package/bin/localization-builder.js +1 -1
  4. package/bin/nspell-index.js +1 -1
  5. package/bin/nspell.webpack.config.js +1 -1
  6. package/bin/webpack-externals.js +3 -1
  7. package/bin/webpack.config.js +1 -1
  8. package/dist/dx.richedit.css +1 -0
  9. package/dist/dx.richedit.d.ts +17 -10
  10. package/dist/dx.richedit.js +53229 -51846
  11. package/dist/dx.richedit.min.js +2 -2
  12. package/index.d.ts +1 -1
  13. package/index.js +1 -1
  14. package/lib/client/bars/ribbon.js +2 -1
  15. package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +2 -1
  16. package/lib/client/client-rich-edit.js +4 -3
  17. package/lib/client/commands/client-command-manager.js +2 -1
  18. package/lib/client/commands/commands.js +3 -0
  19. package/lib/client/commands/download-document-command.d.ts +3 -0
  20. package/lib/client/commands/download-document-command.js +13 -2
  21. package/lib/client/commands/export-document-command.js +4 -4
  22. package/lib/client/commands/mail-merge-command.js +7 -4
  23. package/lib/client/commands/open-document-command.d.ts +2 -1
  24. package/lib/client/commands/open-document-command.js +17 -12
  25. package/lib/client/default-localization.js +2 -1
  26. package/lib/client/dialogs/finish-and-merge-dialog.js +1 -0
  27. package/lib/client/document-processor/processor.d.ts +9 -2
  28. package/lib/client/document-processor/processor.js +18 -6
  29. package/lib/client/formats/docx/export/data.d.ts +4 -0
  30. package/lib/client/formats/docx/export/data.js +12 -0
  31. package/lib/client/formats/docx/export/exporter.d.ts +2 -0
  32. package/lib/client/formats/docx/export/exporter.js +15 -0
  33. package/lib/client/formats/docx/export/exporters/base/sections.js +5 -0
  34. package/lib/client/formats/docx/export/exporters/note-properties.d.ts +18 -0
  35. package/lib/client/formats/docx/export/exporters/note-properties.js +83 -0
  36. package/lib/client/formats/docx/export/exporters/settings.d.ts +2 -0
  37. package/lib/client/formats/docx/export/exporters/settings.js +11 -0
  38. package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.d.ts +15 -1
  39. package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.js +85 -3
  40. package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.d.ts +2 -2
  41. package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.js +2 -2
  42. package/lib/client/formats/docx/export/exporters/sub-document/main-sub-document.d.ts +2 -2
  43. package/lib/client/formats/docx/export/exporters/sub-document/main-sub-document.js +2 -2
  44. package/lib/client/formats/docx/export/exporters/sub-document/note-sub-document-exporter.d.ts +37 -0
  45. package/lib/client/formats/docx/export/exporters/sub-document/note-sub-document-exporter.js +71 -0
  46. package/lib/client/formats/docx/export/exporters/sub-document/text-box-content-exporter.d.ts +2 -2
  47. package/lib/client/formats/docx/export/exporters/sub-document/text-box-content-exporter.js +2 -2
  48. package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-properties-destination.d.ts +16 -0
  49. package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-properties-destination.js +48 -0
  50. package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-reference-destination.d.ts +5 -0
  51. package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-reference-destination.js +9 -0
  52. package/lib/client/formats/docx/import/destination/notes/endnotes/endnotes-destination.d.ts +5 -0
  53. package/lib/client/formats/docx/import/destination/notes/endnotes/endnotes-destination.js +39 -0
  54. package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-properties-destination.d.ts +18 -0
  55. package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-properties-destination.js +49 -0
  56. package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-reference-destination.d.ts +5 -0
  57. package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-reference-destination.js +9 -0
  58. package/lib/client/formats/docx/import/destination/notes/footnotes/footnotes-destination.d.ts +5 -0
  59. package/lib/client/formats/docx/import/destination/notes/footnotes/footnotes-destination.js +39 -0
  60. package/lib/client/formats/docx/import/destination/notes/note-destination.d.ts +18 -0
  61. package/lib/client/formats/docx/import/destination/notes/note-destination.js +45 -0
  62. package/lib/client/formats/docx/import/destination/notes/note-properties-destination.d.ts +32 -0
  63. package/lib/client/formats/docx/import/destination/notes/note-properties-destination.js +81 -0
  64. package/lib/client/formats/docx/import/destination/notes/note-reference-destination.d.ts +8 -0
  65. package/lib/client/formats/docx/import/destination/notes/note-reference-destination.js +21 -0
  66. package/lib/client/formats/docx/import/destination/notes/note-self-reference-destination.d.ts +5 -0
  67. package/lib/client/formats/docx/import/destination/notes/note-self-reference-destination.js +12 -0
  68. package/lib/client/formats/docx/import/destination/notes/note-separator-destination.d.ts +8 -0
  69. package/lib/client/formats/docx/import/destination/notes/note-separator-destination.js +20 -0
  70. package/lib/client/formats/docx/import/destination/paragraph-properties/paragraph-numbering-reference-destination.js +1 -1
  71. package/lib/client/formats/docx/import/destination/runs/run-destination.js +11 -5
  72. package/lib/client/formats/docx/import/destination/section/section-destination.js +5 -2
  73. package/lib/client/formats/docx/import/destination/settings/settings.js +4 -0
  74. package/lib/client/formats/docx/import/importer.d.ts +2 -0
  75. package/lib/client/formats/docx/import/importer.js +26 -0
  76. package/lib/client/formats/docx/import/importers/character-importer.d.ts +3 -0
  77. package/lib/client/formats/docx/import/importers/character-importer.js +12 -1
  78. package/lib/client/formats/docx/import/importers/end-notes-importer.d.ts +3 -4
  79. package/lib/client/formats/docx/import/importers/end-notes-importer.js +8 -3
  80. package/lib/client/formats/docx/import/importers/foot-notes-importer.d.ts +3 -5
  81. package/lib/client/formats/docx/import/importers/foot-notes-importer.js +8 -5
  82. package/lib/client/formats/docx/import/importers/notes-importer.d.ts +8 -0
  83. package/lib/client/formats/docx/import/importers/notes-importer.js +7 -0
  84. package/lib/client/formats/docx/translation-table/translation-tables.d.ts +7 -0
  85. package/lib/client/formats/docx/translation-table/translation-tables.js +27 -0
  86. package/lib/client/formats/docx/utils/constants.d.ts +2 -0
  87. package/lib/client/formats/docx/utils/constants.js +2 -0
  88. package/lib/client/model-api/formats/enum.d.ts +1 -0
  89. package/lib/client/model-api/formats/enum.js +1 -0
  90. package/lib/client/model-api/formats/exporter.d.ts +3 -4
  91. package/lib/client/model-api/formats/exporter.js +9 -6
  92. package/lib/client/model-api/formats/importer.js +2 -0
  93. package/lib/client/model-api/sub-document.d.ts +6 -2
  94. package/lib/client/model-api/sub-document.js +37 -35
  95. package/lib/client/model-api/table/table-borders.d.ts +1 -1
  96. package/lib/client/public/commands/enum.d.ts +1 -0
  97. package/lib/client/public/commands/enum.js +1 -0
  98. package/lib/client/public/document-processor.d.ts +3 -1
  99. package/lib/client/public/document-processor.js +2 -2
  100. package/lib/client/public/ribbon/creator.js +1 -0
  101. package/lib/client/public/ribbon/item-ids.d.ts +1 -0
  102. package/lib/client/public/ribbon/item-ids.js +1 -0
  103. package/lib/client/public/ribbon/items/select-box.d.ts +2 -0
  104. package/lib/client/public/ribbon/items/select-box.js +7 -0
  105. package/lib/client/public/rich-edit.d.ts +2 -1
  106. package/lib/client/public/rich-edit.js +16 -9
  107. package/lib/client/public/utils.d.ts +4 -0
  108. package/lib/client/public/utils.js +15 -0
  109. package/lib/client/ribbon/i-toolbar-item-options.d.ts +1 -0
  110. package/lib/common/canvas/canvas-manager.js +1 -0
  111. package/lib/common/canvas/picture-renderer.d.ts +1 -1
  112. package/lib/common/canvas/renderes/common/document-renderer.d.ts +1 -1
  113. package/lib/common/canvas/renderes/common/document-renderer.js +6 -2
  114. package/lib/common/canvas/renderes/view-manager.js +3 -1
  115. package/lib/common/clipboard-content-inserter.js +2 -1
  116. package/lib/common/commands/client-command.d.ts +3 -1
  117. package/lib/common/commands/client-command.js +2 -0
  118. package/lib/common/commands/document/print-document-on-client-command.js +1 -1
  119. package/lib/common/commands/text/clipboard-commands.js +7 -5
  120. package/lib/common/document-format.d.ts +2 -0
  121. package/lib/common/document-format.js +2 -0
  122. package/lib/common/formats/document-importer-errors.d.ts +3 -1
  123. package/lib/common/formats/document-importer-errors.js +2 -0
  124. package/lib/common/formats/file-name-helper.d.ts +1 -0
  125. package/lib/common/formats/file-name-helper.js +7 -1
  126. package/lib/common/formats/html/export/get-html.d.ts +4 -0
  127. package/lib/common/formats/html/export/get-html.js +12 -0
  128. package/lib/common/formats/html/export/html-builder.d.ts +16 -0
  129. package/lib/common/formats/html/export/html-builder.js +102 -0
  130. package/lib/common/formats/html/export/html-document-exporter.d.ts +13 -0
  131. package/lib/common/formats/html/export/html-document-exporter.js +29 -0
  132. package/lib/common/formats/html/export/html-export.d.ts +37 -0
  133. package/lib/common/{html-export.js → formats/html/export/html-export.js} +226 -289
  134. package/lib/common/formats/html/import/html-document-importer.d.ts +15 -0
  135. package/lib/common/formats/html/import/html-document-importer.js +84 -0
  136. package/lib/common/formats/html/import/html-importer.d.ts +1 -0
  137. package/lib/common/formats/html/import/html-importer.js +34 -9
  138. package/lib/common/formats/html/import/insert-html.d.ts +4 -0
  139. package/lib/common/formats/html/import/insert-html.js +5 -0
  140. package/lib/common/formats/html/import/utils/paragraph-properties-utils.d.ts +1 -0
  141. package/lib/common/formats/html/import/utils/paragraph-properties-utils.js +17 -4
  142. package/lib/common/formats/i-document-exporter.d.ts +14 -0
  143. package/lib/common/formats/rtf/export/exporter.d.ts +1 -1
  144. package/lib/common/formats/rtf/export/exporter.js +1 -1
  145. package/lib/common/formats/rtf/importer-in-subdocument.d.ts +1 -1
  146. package/lib/common/formats/rtf/importer-in-subdocument.js +1 -1
  147. package/lib/common/formats/txt/txt-exporter.js +2 -1
  148. package/lib/common/input-controller.d.ts +2 -1
  149. package/lib/common/input-controller.js +5 -2
  150. package/lib/common/interfaces/i-rich-edit-core.d.ts +2 -0
  151. package/lib/common/layout/main-structures/layout-boxes/layout-anchored-picture-box.d.ts +2 -1
  152. package/lib/common/layout/main-structures/layout-boxes/layout-anchored-picture-box.js +4 -3
  153. package/lib/common/layout/main-structures/layout-boxes/layout-picture-box.d.ts +2 -1
  154. package/lib/common/layout/main-structures/layout-boxes/layout-picture-box.js +5 -4
  155. package/lib/common/layout/main-structures/layout-page.d.ts +1 -0
  156. package/lib/common/layout/main-structures/layout-page.js +5 -2
  157. package/lib/common/layout-formatter/box/generator/box-infos-generator.d.ts +1 -0
  158. package/lib/common/layout-formatter/box/generator/box-infos-generator.js +12 -2
  159. package/lib/common/layout-formatter/floating/page-anchored-object-holder.d.ts +5 -3
  160. package/lib/common/layout-formatter/floating/page-anchored-object-holder.js +7 -4
  161. package/lib/common/layout-formatter/formatter/base-formatter.js +0 -1
  162. package/lib/common/layout-formatter/formatter/main-formatter.js +1 -0
  163. package/lib/common/layout-formatter/managers/formatter-manager.d.ts +6 -2
  164. package/lib/common/layout-formatter/managers/formatter-manager.js +3 -1
  165. package/lib/common/layout-formatter/row/size-engine/row-sizes-manager.js +20 -4
  166. package/lib/common/measurer/measurer.js +2 -1
  167. package/lib/common/model/chunk.d.ts +1 -0
  168. package/lib/common/model/chunk.js +27 -2
  169. package/lib/common/model/document-model.d.ts +4 -0
  170. package/lib/common/model/document-model.js +4 -1
  171. package/lib/common/model/enums.d.ts +3 -1
  172. package/lib/common/model/enums.js +2 -0
  173. package/lib/common/model/footnotes/footnote.d.ts +46 -0
  174. package/lib/common/model/footnotes/footnote.js +100 -0
  175. package/lib/common/model/json/importers/sub-document/json-sub-document-importer.js +3 -3
  176. package/lib/common/model/json/importers/sub-document/run-importers.d.ts +6 -0
  177. package/lib/common/model/json/importers/sub-document/run-importers.js +9 -0
  178. package/lib/common/model/model-checks/position.d.ts +2 -1
  179. package/lib/common/model/model-checks/position.js +11 -2
  180. package/lib/common/model/numbering-lists/numbering-helper.d.ts +2 -1
  181. package/lib/common/model/numbering-lists/numbering-helper.js +3 -0
  182. package/lib/common/model/paragraph/paragraph-style.d.ts +1 -0
  183. package/lib/common/model/paragraph/paragraph-style.js +6 -2
  184. package/lib/common/model/properties-merger/paragraph-properties-merger.js +1 -1
  185. package/lib/common/model/runs/run-base.d.ts +1 -0
  186. package/lib/common/model/runs/simple-runs.d.ts +8 -2
  187. package/lib/common/model/runs/simple-runs.js +12 -6
  188. package/lib/common/model/section/section-properties.d.ts +3 -0
  189. package/lib/common/model/special-characters.d.ts +3 -0
  190. package/lib/common/model/special-characters.js +3 -0
  191. package/lib/common/model/sub-document-infos.d.ts +18 -0
  192. package/lib/common/model/sub-document-infos.js +39 -0
  193. package/lib/common/model/sub-document.d.ts +2 -0
  194. package/lib/common/model/sub-document.js +18 -16
  195. package/lib/common/mouse-handler/touch-handler/touch-handler-state-base.d.ts +1 -0
  196. package/lib/common/mouse-handler/touch-handler/touch-handler-state-base.js +21 -13
  197. package/lib/common/processor.d.ts +2 -0
  198. package/lib/common/rich-edit-core.d.ts +6 -2
  199. package/lib/common/rich-edit-core.js +20 -1
  200. package/lib/common/selection/selection-intervals-info.js +1 -1
  201. package/lib/common/ui/ruler/controls/divisions.js +2 -1
  202. package/lib/common/ui/ruler/controls/indent/first-line.js +4 -3
  203. package/lib/common/ui/ruler/controls/indent/left.js +5 -4
  204. package/lib/common/ui/ruler/ruler.js +2 -1
  205. package/lib/common/utils/_license.d.ts +1 -0
  206. package/lib/common/utils/_license.js +2 -0
  207. package/lib/common/utils/size-utils.d.ts +3 -0
  208. package/lib/common/utils/size-utils.js +17 -4
  209. package/package.json +4 -4
  210. package/lib/common/html-export.d.ts +0 -32
@@ -73,26 +73,32 @@ export class LayoutDependentRun extends OneCharRun {
73
73
  return new LayoutDependentRun(this.startOffset, subDocument.getParagraphByPosition(this.paragraph.startLogPosition.value), new MaskedCharacterPropertiesBundle(subDocument.documentModel.cache.maskedCharacterPropertiesCache.getItem(this.maskedCharacterProperties), subDocument.documentModel.stylesManager.getCharacterStyleByName(this.characterStyle.styleName)));
74
74
  }
75
75
  }
76
- export class FootNoteRun extends OneCharRun {
76
+ class NoteRun extends OneCharRun {
77
+ constructor(startOffset, paragraph, charPropsBundle, noteDocumentId = -1) {
78
+ super(startOffset, paragraph, charPropsBundle);
79
+ this.noteDocumentId = noteDocumentId;
80
+ }
81
+ }
82
+ export class FootNoteRun extends NoteRun {
77
83
  getType() {
78
84
  return RunType.FootNoteRun;
79
85
  }
80
86
  clone() {
81
- return new FootNoteRun(this.startOffset, this.paragraph, new MaskedCharacterPropertiesBundle(this.maskedCharacterProperties, this.characterStyle));
87
+ return new FootNoteRun(this.startOffset, this.paragraph, new MaskedCharacterPropertiesBundle(this.maskedCharacterProperties, this.characterStyle), this.noteDocumentId);
82
88
  }
83
89
  cloneToNewSubDocument(subDocument) {
84
- return new FootNoteRun(this.startOffset, subDocument.getParagraphByPosition(this.paragraph.startLogPosition.value), new MaskedCharacterPropertiesBundle(subDocument.documentModel.cache.maskedCharacterPropertiesCache.getItem(this.maskedCharacterProperties), subDocument.documentModel.stylesManager.getCharacterStyleByName(this.characterStyle.styleName)));
90
+ return new FootNoteRun(this.startOffset, subDocument.getParagraphByPosition(this.paragraph.startLogPosition.value), new MaskedCharacterPropertiesBundle(subDocument.documentModel.cache.maskedCharacterPropertiesCache.getItem(this.maskedCharacterProperties), subDocument.documentModel.stylesManager.getCharacterStyleByName(this.characterStyle.styleName)), this.noteDocumentId);
85
91
  }
86
92
  }
87
- export class EndNoteRun extends OneCharRun {
93
+ export class EndNoteRun extends NoteRun {
88
94
  getType() {
89
95
  return RunType.EndNoteRun;
90
96
  }
91
97
  clone() {
92
- return new EndNoteRun(this.startOffset, this.paragraph, new MaskedCharacterPropertiesBundle(this.maskedCharacterProperties, this.characterStyle));
98
+ return new EndNoteRun(this.startOffset, this.paragraph, new MaskedCharacterPropertiesBundle(this.maskedCharacterProperties, this.characterStyle), this.noteDocumentId);
93
99
  }
94
100
  cloneToNewSubDocument(subDocument) {
95
- return new EndNoteRun(this.startOffset, subDocument.getParagraphByPosition(this.paragraph.startLogPosition.value), new MaskedCharacterPropertiesBundle(subDocument.documentModel.cache.maskedCharacterPropertiesCache.getItem(this.maskedCharacterProperties), subDocument.documentModel.stylesManager.getCharacterStyleByName(this.characterStyle.styleName)));
101
+ return new EndNoteRun(this.startOffset, subDocument.getParagraphByPosition(this.paragraph.startLogPosition.value), new MaskedCharacterPropertiesBundle(subDocument.documentModel.cache.maskedCharacterPropertiesCache.getItem(this.maskedCharacterProperties), subDocument.documentModel.stylesManager.getCharacterStyleByName(this.characterStyle.styleName)), this.noteDocumentId);
96
102
  }
97
103
  }
98
104
  export class NoteSeparatorRun extends OneCharRun {
@@ -5,6 +5,7 @@ import { SectionStartType } from './enums';
5
5
  import { SectionColumnProperties } from './section-column-properties';
6
6
  import { PaperKind } from './paper-kind';
7
7
  import { LineNumberingProperties } from './line-numbering-properties';
8
+ import { NoteProperties } from '../footnotes/footnote';
8
9
  export declare class SectionProperties implements ICloneable<SectionProperties>, ISupportCopyFrom<SectionProperties> {
9
10
  static createSimpleSectionProperties(width: number, height: number): SectionProperties;
10
11
  margins: Margins;
@@ -22,6 +23,8 @@ export declare class SectionProperties implements ICloneable<SectionProperties>,
22
23
  firstPageNumber: number;
23
24
  continueNumbering: boolean;
24
25
  lineNumbering: LineNumberingProperties;
26
+ footNote: NoteProperties;
27
+ endNote: NoteProperties;
25
28
  get marginLeft(): number;
26
29
  get marginTop(): number;
27
30
  get marginRight(): number;
@@ -39,6 +39,7 @@ export declare class SpecialCharacters {
39
39
  OpeningDoubleQuotationMark: string;
40
40
  ClosingDoubleQuotationMark: string;
41
41
  SeparatorMark: string;
42
+ MSWordBulletMark: string;
42
43
  HiddenLineBreak: string;
43
44
  HiddenParagraphMark: string;
44
45
  HiddenSpace: string;
@@ -47,5 +48,7 @@ export declare class SpecialCharacters {
47
48
  FieldCodeEndRun: string;
48
49
  FieldResultEndRun: string;
49
50
  LayoutDependentText: string;
51
+ ETX: string;
52
+ EOT: string;
50
53
  DEBUG_CONVERTER(str: string): string;
51
54
  }
@@ -40,6 +40,7 @@ export class SpecialCharacters {
40
40
  this.OpeningDoubleQuotationMark = '\u201C';
41
41
  this.ClosingDoubleQuotationMark = '\u201D';
42
42
  this.SeparatorMark = '|';
43
+ this.MSWordBulletMark = String.fromCharCode(0xF0B7);
43
44
  this.HiddenLineBreak = String.fromCharCode(0x21B2);
44
45
  this.HiddenParagraphMark = String.fromCharCode(0x00B6);
45
46
  this.HiddenSpace = String.fromCharCode(0x00B7);
@@ -48,6 +49,8 @@ export class SpecialCharacters {
48
49
  this.FieldCodeEndRun = "}";
49
50
  this.FieldResultEndRun = ">";
50
51
  this.LayoutDependentText = "#";
52
+ this.ETX = '\u0003';
53
+ this.EOT = '\u0004';
51
54
  }
52
55
  DEBUG_CONVERTER(str) {
53
56
  let result = [];
@@ -1,6 +1,7 @@
1
1
  import { DocumentModel } from './document-model';
2
2
  import { SubDocumentInfoType } from './enums';
3
3
  import { HeaderFooterType } from './section/enums';
4
+ import { NoteType } from './footnotes/footnote';
4
5
  export declare abstract class SubDocumentInfoBase {
5
6
  subDocumentId: number;
6
7
  isMain: boolean;
@@ -28,6 +29,23 @@ export declare class TextBoxSubDocumentInfoBase extends SubDocumentInfoBase {
28
29
  getType(): SubDocumentInfoType;
29
30
  clone(): TextBoxSubDocumentInfoBase;
30
31
  }
32
+ export declare abstract class NoteSubDocumentInfo extends SubDocumentInfoBase {
33
+ isMain: boolean;
34
+ isNote: boolean;
35
+ noteType: NoteType;
36
+ }
37
+ export declare class FootNoteSubDocumentInfo extends NoteSubDocumentInfo {
38
+ isMain: boolean;
39
+ isFootNote: boolean;
40
+ getType(): SubDocumentInfoType;
41
+ clone(): FootNoteSubDocumentInfo;
42
+ }
43
+ export declare class EndNoteSubDocumentInfo extends NoteSubDocumentInfo {
44
+ isMain: boolean;
45
+ isEndNote: boolean;
46
+ getType(): SubDocumentInfoType;
47
+ clone(): EndNoteSubDocumentInfo;
48
+ }
31
49
  export declare class MainSubDocumentInfo extends SubDocumentInfoBase {
32
50
  constructor();
33
51
  getType(): SubDocumentInfoType;
@@ -1,6 +1,7 @@
1
1
  import { Errors } from '@devexpress/utils/lib/errors';
2
2
  import { SubDocumentInfoType } from './enums';
3
3
  import { HeaderFooterType } from './section/enums';
4
+ import { NoteType } from './footnotes/footnote';
4
5
  export class SubDocumentInfoBase {
5
6
  constructor(subDocumentId) {
6
7
  this.isMain = true;
@@ -31,6 +32,10 @@ export class SubDocumentInfoBase {
31
32
  return new FooterSubDocumentInfo(subDocumentId);
32
33
  case SubDocumentInfoType.TextBox:
33
34
  return new TextBoxSubDocumentInfoBase(subDocumentId, parentSubDocumentId);
35
+ case SubDocumentInfoType.FootNote:
36
+ return new FootNoteSubDocumentInfo(subDocumentId);
37
+ case SubDocumentInfoType.EndNote:
38
+ return new EndNoteSubDocumentInfo(subDocumentId);
34
39
  }
35
40
  throw new Error(Errors.NotImplemented);
36
41
  }
@@ -49,6 +54,40 @@ export class TextBoxSubDocumentInfoBase extends SubDocumentInfoBase {
49
54
  return new TextBoxSubDocumentInfoBase(this.subDocumentId, this.parentSubDocumentId);
50
55
  }
51
56
  }
57
+ export class NoteSubDocumentInfo extends SubDocumentInfoBase {
58
+ constructor() {
59
+ super(...arguments);
60
+ this.isMain = false;
61
+ this.isNote = true;
62
+ this.noteType = NoteType.Normal;
63
+ }
64
+ }
65
+ export class FootNoteSubDocumentInfo extends NoteSubDocumentInfo {
66
+ constructor() {
67
+ super(...arguments);
68
+ this.isMain = false;
69
+ this.isFootNote = true;
70
+ }
71
+ getType() {
72
+ return SubDocumentInfoType.FootNote;
73
+ }
74
+ clone() {
75
+ return new FootNoteSubDocumentInfo(this.subDocumentId);
76
+ }
77
+ }
78
+ export class EndNoteSubDocumentInfo extends NoteSubDocumentInfo {
79
+ constructor() {
80
+ super(...arguments);
81
+ this.isMain = false;
82
+ this.isEndNote = true;
83
+ }
84
+ getType() {
85
+ return SubDocumentInfoType.EndNote;
86
+ }
87
+ clone() {
88
+ return new EndNoteSubDocumentInfo(this.subDocumentId);
89
+ }
90
+ }
52
91
  export class MainSubDocumentInfo extends SubDocumentInfoBase {
53
92
  constructor() {
54
93
  super(0);
@@ -40,6 +40,8 @@ export declare class SubDocument {
40
40
  get interval(): FixedInterval;
41
41
  getLastChunk(): Chunk;
42
42
  getFirstChunk(): Chunk;
43
+ getLastParagraph(): Paragraph;
44
+ getFirstParagraph(): Paragraph;
43
45
  getText(interval?: FixedInterval): string;
44
46
  getSimpleText(interval: ConstInterval): string;
45
47
  splitRun(position: number): void;
@@ -37,6 +37,12 @@ export class SubDocument {
37
37
  getFirstChunk() {
38
38
  return this.chunks[0];
39
39
  }
40
+ getLastParagraph() {
41
+ return this.paragraphs[this.paragraphs.length - 1];
42
+ }
43
+ getFirstParagraph() {
44
+ return this.paragraphs[0];
45
+ }
40
46
  getText(interval = new FixedInterval(0, this.getDocumentEndPosition())) {
41
47
  var buffer = "";
42
48
  var chunkIndex = SearchUtils.normedInterpolationIndexOf(this.chunks, (c) => c.startLogPosition.value, interval.start);
@@ -407,8 +413,8 @@ export class SubDocumentPosition {
407
413
  this.position = position;
408
414
  }
409
415
  validateInterval() {
410
- const docEnd = this.subDocument.getDocumentEndPosition();
411
- this.position = Math.min(docEnd - 1, this.position);
416
+ const documentEndPosition = this.subDocument.getDocumentEndPosition();
417
+ this.position = Math.min(this.position, documentEndPosition - 1);
412
418
  }
413
419
  clone() {
414
420
  return new SubDocumentPosition(this.subDocument, this.position);
@@ -431,11 +437,7 @@ export class SubDocumentInterval {
431
437
  return new SubDocumentInterval(this.subDocument, this.interval.clone());
432
438
  }
433
439
  validateInterval() {
434
- const docEnd = this.subDocument.getDocumentEndPosition();
435
- if (this.interval.start == 0 && this.interval.end == docEnd)
436
- return;
437
- this.interval.start = Math.min(docEnd, this.interval.start);
438
- this.interval.end = Math.min(docEnd, this.interval.end);
440
+ internalValidateInterval(this.subDocument, this.interval);
439
441
  }
440
442
  equals(obj) {
441
443
  return obj &&
@@ -450,15 +452,8 @@ export class SubDocumentIntervals {
450
452
  }
451
453
  get multiselection() { return this.intervals.length > 1; }
452
454
  validateInterval() {
453
- const docEnd = this.subDocument.getDocumentEndPosition();
454
- for (let curr of this.intervals) {
455
- if (curr.start == 0 && curr.end == docEnd)
456
- continue;
457
- const start = Math.min(docEnd - 1, curr.start);
458
- const end = Math.min(docEnd - 1, curr.end);
459
- curr.start = start;
460
- curr.end = end;
461
- }
455
+ for (let interval of this.intervals)
456
+ internalValidateInterval(this.subDocument, interval);
462
457
  }
463
458
  clone() {
464
459
  return new SubDocumentIntervals(this.subDocument, ListUtils.deepCopy(this.intervals));
@@ -472,3 +467,10 @@ export class SubDocumentIntervals {
472
467
  return new SubDocumentIntervals(subDocument, [new FixedInterval(pos, 0)]);
473
468
  }
474
469
  }
470
+ function internalValidateInterval(subDocument, interval) {
471
+ const documentEndPosition = subDocument.getDocumentEndPosition();
472
+ if (interval.start == 0 && interval.end == documentEndPosition)
473
+ return;
474
+ interval.start = Math.min(interval.start, documentEndPosition - 1);
475
+ interval.end = Math.min(interval.end, documentEndPosition);
476
+ }
@@ -15,6 +15,7 @@ export declare class TouchHandlerStateBase extends ManipulatorHandlerStateBase<T
15
15
  showPopupMenu(): void;
16
16
  setEditableDocumentContent(): void;
17
17
  setLastLayoutPosition(): void;
18
+ private createLayoutPosition;
18
19
  }
19
20
  export declare class TouchHandlerBeginDragHelperState extends TouchHandlerStateBase {
20
21
  dragState: TouchHandlerStateBase;
@@ -4,6 +4,8 @@ import { LayoutWordBounds } from '../../word-bounds-engine/layout-word-bounds';
4
4
  import { Browser } from '@devexpress/utils/lib/browser';
5
5
  import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
6
6
  import { ManipulatorHandlerStateBase } from '../base/manipulator-handler-state-base';
7
+ import { SubDocumentPosition } from '../../../common/model/sub-document';
8
+ import { LayoutBoxType } from '../../../common/layout/main-structures/layout-boxes/layout-box';
7
9
  export class TouchHandlerStateBase extends ManipulatorHandlerStateBase {
8
10
  constructor() {
9
11
  super(...arguments);
@@ -27,15 +29,15 @@ export class TouchHandlerStateBase extends ManipulatorHandlerStateBase {
27
29
  if (!Browser.IE && !Browser.Edge) {
28
30
  var subDocument = this.handler.control.selection.activeSubDocument;
29
31
  let position = this.handler.control.selection.lastSelectedInterval.start;
30
- let startInterval = LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, this.handler.control.selection.activeSubDocument, this.handler.control.selection, position);
31
- let startIntervalLayoutPosition = (subDocument.isMain()
32
- ? new LayoutPositionMainSubDocumentCreator(this.handler.control.layout, subDocument, startInterval, DocumentLayoutDetailsLevel.Box)
33
- : new LayoutPositionOtherSubDocumentCreator(this.handler.control.layout, subDocument, startInterval, this.handler.control.selection.pageIndex, DocumentLayoutDetailsLevel.Box))
34
- .create(new LayoutPositionCreatorConflictFlags().setDefault(this.handler.control.selection.endOfLine), new LayoutPositionCreatorConflictFlags().setDefault(false));
35
- if (startIntervalLayoutPosition.isLastBoxInRow())
36
- startInterval = LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, this.handler.control.selection.activeSubDocument, this.handler.control.selection, position - 1);
37
- let endInterval = LayoutWordBounds.getLayoutWordEndBound(this.handler.control.layout, this.handler.control.selection.activeSubDocument, this.handler.control.selection, startInterval, false);
38
- let textUnderCursor = position >= startInterval && position <= endInterval ? this.handler.control.selection.activeSubDocument.getText(new FixedInterval(startInterval, endInterval - startInterval)) : "";
32
+ let startInterval = LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, subDocument, this.handler.control.selection, position);
33
+ let startIntervalLayoutPosition = this.createLayoutPosition(new SubDocumentPosition(subDocument, startInterval), DocumentLayoutDetailsLevel.Box);
34
+ if (startIntervalLayoutPosition.isLastBoxInRow()) {
35
+ const prevPosition = this.createLayoutPosition(new SubDocumentPosition(subDocument, position - 1), DocumentLayoutDetailsLevel.Box);
36
+ if (prevPosition.detailsLevel !== DocumentLayoutDetailsLevel.Box || prevPosition.box.getType() !== LayoutBoxType.PageBreak)
37
+ startInterval = LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, subDocument, this.handler.control.selection, position - 1);
38
+ }
39
+ let endInterval = LayoutWordBounds.getLayoutWordEndBound(this.handler.control.layout, subDocument, this.handler.control.selection, startInterval, false);
40
+ let textUnderCursor = position >= startInterval && position <= endInterval ? subDocument.getText(new FixedInterval(startInterval, endInterval - startInterval)) : "";
39
41
  this.handler.control.inputController.setEditableDocumentContent(textUnderCursor);
40
42
  if (textUnderCursor.length)
41
43
  this.handler.control.inputController.setEditableDocumentCursorPosition(position - startInterval);
@@ -44,10 +46,16 @@ export class TouchHandlerStateBase extends ManipulatorHandlerStateBase {
44
46
  setLastLayoutPosition() {
45
47
  var subDocument = this.handler.control.selection.activeSubDocument;
46
48
  var logPosition = this.handler.control.selection.lastSelectedInterval.start;
47
- this.lastLayoutPosition = (subDocument.isMain()
48
- ? new LayoutPositionMainSubDocumentCreator(this.handler.control.layout, subDocument, logPosition, DocumentLayoutDetailsLevel.Character)
49
- : new LayoutPositionOtherSubDocumentCreator(this.handler.control.layout, subDocument, logPosition, this.handler.control.selection.pageIndex, DocumentLayoutDetailsLevel.Character))
50
- .create(new LayoutPositionCreatorConflictFlags().setDefault(this.handler.control.selection.endOfLine), new LayoutPositionCreatorConflictFlags().setDefault(true));
49
+ this.lastLayoutPosition = this.createLayoutPosition(new SubDocumentPosition(subDocument, logPosition), DocumentLayoutDetailsLevel.Character, true);
50
+ }
51
+ createLayoutPosition(subDocPos, detailsLevel, useNextBoxBounds = false) {
52
+ const subDocument = subDocPos.subDocument;
53
+ const position = subDocPos.position;
54
+ const endRowConflictFlags = new LayoutPositionCreatorConflictFlags().setDefault(this.handler.control.selection.endOfLine);
55
+ const middleRowConflictFlags = new LayoutPositionCreatorConflictFlags().setDefault(useNextBoxBounds);
56
+ return (subDocument.isMain()
57
+ ? new LayoutPositionMainSubDocumentCreator(this.handler.control.layout, subDocument, position, detailsLevel)
58
+ : new LayoutPositionOtherSubDocumentCreator(this.handler.control.layout, subDocument, position, this.handler.control.selection.pageIndex, detailsLevel)).create(endRowConflictFlags, middleRowConflictFlags);
51
59
  }
52
60
  }
53
61
  export class TouchHandlerBeginDragHelperState extends TouchHandlerStateBase {
@@ -3,10 +3,12 @@ import { FormatterManager } from './layout-formatter/managers/formatter-manager'
3
3
  import { IModelManager } from './model-manager';
4
4
  import { FieldRequestManager } from './model/fields/field-request-manager';
5
5
  import { ISelectionBase } from './selection/selection-base';
6
+ import { IExportModelOptions } from './formats/i-document-exporter';
6
7
  export interface IProcessor extends IBatchUpdatableObject {
7
8
  selection: ISelectionBase;
8
9
  modelManager: IModelManager;
9
10
  layoutFormatterManager: FormatterManager;
11
+ getExportModelOptions(initOptions?: Partial<IExportModelOptions>): IExportModelOptions;
10
12
  createFieldRequestManager(): FieldRequestManager;
11
13
  invalidateLayoutAfterFontsLoaded(): any;
12
14
  }
@@ -36,6 +36,7 @@ import { SelectionModelChangesListener } from './selection/selection-model-chang
36
36
  import { IRulerControl } from './ui/ruler/ruler';
37
37
  import { RulerSettings } from './ui/ruler/settings';
38
38
  import { SearchManager } from './ui/search-manager';
39
+ import { IExportModelOptions } from './formats/i-document-exporter';
39
40
  export declare abstract class RichEditCore implements IRichEditControl {
40
41
  modelManager: IModelManager;
41
42
  barHolder: IBarHolder;
@@ -113,6 +114,7 @@ export declare abstract class RichEditCore implements IRichEditControl {
113
114
  isRibbon(element: HTMLElement): boolean;
114
115
  isClosed(): boolean;
115
116
  invalidateLayoutAfterFontsLoaded(): void;
117
+ getExportModelOptions(initOptions?: Partial<IExportModelOptions>): IExportModelOptions;
116
118
  protected abstract createSpellChecker(): any;
117
119
  protected createViewElement(id: string, element: HTMLElement): HTMLDivElement;
118
120
  private isUsedInnerClipboard;
@@ -122,12 +124,14 @@ export declare class DocumentInfo {
122
124
  static defaultDocumentName: string;
123
125
  static defaultDocumentFormat: DocumentFormat;
124
126
  private _fileName;
125
- private _documentFormat;
127
+ private _documentFormat?;
128
+ private _documentExtension;
126
129
  readonly documentHasSource: boolean;
127
130
  get fileName(): string;
128
131
  set fileName(val: string);
129
132
  get documentFormat(): DocumentFormat;
130
133
  set documentFormat(val: DocumentFormat);
131
- constructor(fileName: string, documentHasSource: boolean, documentFormat?: DocumentFormat);
134
+ get documentExtension(): string;
135
+ constructor(fileName: string, documentHasSource: boolean, documentFormat?: DocumentFormat, documentExtension?: string);
132
136
  getFileNameForDownload(fileName?: string): string;
133
137
  }
@@ -43,6 +43,7 @@ import { SelectionModelChangesListener } from './selection/selection-model-chang
43
43
  import { SpellCheckerSelectionChangesListener } from './spelling/spell-checker-selection-changes-listener';
44
44
  import { HorizontalRulerControl } from './ui/ruler/ruler';
45
45
  import { SearchManager } from './ui/search-manager';
46
+ import { isDefined } from '@devexpress/utils/lib/utils/common';
46
47
  export class RichEditCore {
47
48
  constructor(owner, name, element, clientGuid, readOnly, barHolder, unitsType, rulerSettings, richOptions, viewsSettings, stringResources) {
48
49
  this.isLoadingPictureFromClipboard = false;
@@ -167,6 +168,7 @@ export class RichEditCore {
167
168
  this.registerActiveContextTabManager();
168
169
  this.modelManager.modelManipulator.modelListeners.push(this.globalEventDispatcher);
169
170
  this.modelManager.modelManipulator.modelListeners.push(this.barHolder.publicUiChangesListener);
171
+ this.inputController.initExporter();
170
172
  }
171
173
  dispose() {
172
174
  var _a, _b;
@@ -376,10 +378,24 @@ export class RichEditCore {
376
378
  this.layoutFormatterManager.invalidator.onChangedAllLayout();
377
379
  }
378
380
  }
381
+ getExportModelOptions(initOptions = {}) {
382
+ return {
383
+ modelManager: isDefined(initOptions.modelManager) ? initOptions.modelManager : this.modelManager,
384
+ pictureRenderer: this.viewManager.renderer,
385
+ uiUnitConverter: this.uiUnitConverter,
386
+ lastMaxNumPages: this.layout.lastMaxNumPages,
387
+ pageIndex: this.selection.pageIndex,
388
+ sessionGuid: this.sessionGuid,
389
+ clientGuid: this.clientGuid,
390
+ documentFormat: isDefined(initOptions.documentFormat) ? initOptions.documentFormat : this.getExportDocumentFormat(),
391
+ };
392
+ }
379
393
  createViewElement(id, element) {
380
394
  const viewElement = document.createElement("DIV");
381
395
  viewElement.id = id + "_View";
382
396
  viewElement.className = "dxreView";
397
+ viewElement.tabIndex = 0;
398
+ viewElement.setAttribute("role", "document");
383
399
  element.appendChild(viewElement);
384
400
  return viewElement;
385
401
  }
@@ -393,9 +409,10 @@ export class RichEditCore {
393
409
  }
394
410
  }
395
411
  export class DocumentInfo {
396
- constructor(fileName, documentHasSource, documentFormat = DocumentInfo.defaultDocumentFormat) {
412
+ constructor(fileName, documentHasSource, documentFormat = DocumentInfo.defaultDocumentFormat, documentExtension = FileNameHelper.convertToString(documentFormat)) {
397
413
  this._fileName = fileName;
398
414
  this._documentFormat = documentFormat;
415
+ this._documentExtension = documentExtension;
399
416
  this.documentHasSource = documentHasSource;
400
417
  }
401
418
  get fileName() { return this._fileName; }
@@ -406,7 +423,9 @@ export class DocumentInfo {
406
423
  this._documentFormat = FileNameHelper.convertExtensionToDocumentFormat(val);
407
424
  else
408
425
  this._documentFormat = val;
426
+ this._documentExtension = FileNameHelper.convertToString(val);
409
427
  }
428
+ get documentExtension() { return this._documentExtension; }
410
429
  getFileNameForDownload(fileName) {
411
430
  if (!StringUtils.isNullOrEmpty(fileName))
412
431
  return fileName;
@@ -47,7 +47,7 @@ export class SelectionIntervalsInfo {
47
47
  const docEnd = this.subDocument.getDocumentEndPosition();
48
48
  for (let curr of this.intervals) {
49
49
  curr.start = Math.max(docEnd - 1, curr.start);
50
- curr.end = Math.max(docEnd - 1, curr.end);
50
+ curr.end = Math.max(docEnd, curr.end);
51
51
  }
52
52
  }
53
53
  equals(obj) {
@@ -4,6 +4,7 @@ import { UnitConverter } from '@devexpress/utils/lib/class/unit-converter';
4
4
  import { DocumentRenderer } from '../../../canvas/renderes/common/document-renderer';
5
5
  import { RULER_CLASS_NAME, RULLER_NUMBER_CORRECTION } from '../settings';
6
6
  import { RulerBase } from './base';
7
+ import { SizeUtils } from '../../../../common/utils/size-utils';
7
8
  export const MINOR_TOP_AND_BOTTOM_MARGIN = 4;
8
9
  export const MAJOR_TOP_AND_BOTTOM_MARGIN = 2;
9
10
  export const DIVISION_CONTAINER_CLASS_NAME = RULER_CLASS_NAME + "Divisions";
@@ -20,7 +21,7 @@ export class RulerDivisionsControl extends RulerBase {
20
21
  this.controls.ruler.rootElement.appendChild(this.rootElement);
21
22
  if (Browser.IE && Browser.MajorVersion <= 9)
22
23
  this.rootElement.offsetParent;
23
- this.height = this.rootElement.offsetHeight;
24
+ this.height = SizeUtils.getOffsetHeight(this.rootElement);
24
25
  createDivisionElements(this.rootElement, unitCount, divisionInfo, this.height);
25
26
  this.initialLeft = -(unitCount * divisionInfo.unitSize - RULLER_NUMBER_CORRECTION);
26
27
  }
@@ -5,6 +5,7 @@ import { RULLER_NUMBER_CORRECTION } from '../../settings';
5
5
  import { RulerModelState } from '../base';
6
6
  import { RulerTemplateManager } from '../template-manager';
7
7
  import { RulerBaseIndentControl, RulerMinDistanceBetweenIndents } from './base';
8
+ import { SizeUtils } from '../../../../../common/utils/size-utils';
8
9
  export class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
9
10
  constructor(modelData, controls) {
10
11
  super(modelData, controls);
@@ -14,8 +15,8 @@ export class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
14
15
  this.rootElement.title = this.modelData.settings.titles.firstLineIndent;
15
16
  this.controls.ruler.rootElement.appendChild(this.rootElement);
16
17
  this.adjustByTop();
17
- this.leftCorrection = Math.round(this.rootElement.offsetWidth / 2);
18
- this._heightOfProtrudingPart = this.rootElement.offsetHeight - this.controls.divisions.height / 2;
18
+ this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
19
+ this._heightOfProtrudingPart = SizeUtils.getOffsetHeight(this.rootElement) - this.controls.divisions.height / 2;
19
20
  }
20
21
  get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
21
22
  getRootClassName() {
@@ -23,7 +24,7 @@ export class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
23
24
  this.modelData.settings.styles.firstLineIndent.className;
24
25
  }
25
26
  adjustByTop() {
26
- const mainElementHeight = this.rootElement.offsetHeight;
27
+ const mainElementHeight = SizeUtils.getOffsetHeight(this.rootElement);
27
28
  const divisionsControlHeight = this.controls.divisions.height;
28
29
  this.rootElement.style.marginTop = (mainElementHeight - divisionsControlHeight) / 2 + "px";
29
30
  }
@@ -6,6 +6,7 @@ import { RICH_EDIT_CLASS_NAME_PREFIX, RULLER_NUMBER_CORRECTION } from '../../set
6
6
  import { RulerModelState } from '../base';
7
7
  import { RulerTemplateManager } from '../template-manager';
8
8
  import { RulerBaseIndentControl, RulerMinDistanceBetweenIndents } from './base';
9
+ import { SizeUtils } from '../../../../../common/utils/size-utils';
9
10
  const LEFT_INDENT_DRAG_HANDLE_BODY = RICH_EDIT_CLASS_NAME_PREFIX + "leftIndentDragHandleBody";
10
11
  export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
11
12
  constructor(modelData, controls) {
@@ -26,18 +27,18 @@ export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
26
27
  const mainElementWidth = this.topElement.offsetWidth;
27
28
  this.bodyElement.style.width = mainElementWidth + "px";
28
29
  const style = this.rootElement.style;
29
- style.height = this.topElement.offsetHeight + this.bodyElement.offsetHeight + "px";
30
+ style.height = SizeUtils.getOffsetHeight(this.topElement) + SizeUtils.getOffsetHeight(this.bodyElement) + "px";
30
31
  style.width = mainElementWidth + "px";
31
32
  style.marginTop = this.controls.divisions.height / 2 + "px";
32
33
  this.bodyElement.title = this.modelData.settings.titles.leftIndent;
33
34
  this.topElement.title = this.modelData.settings.titles.hangingIndent;
34
- this.leftCorrection = Math.round(this.rootElement.offsetWidth / 2);
35
- this._heightOfProtrudingPart = this.rootElement.offsetHeight - this.controls.divisions.height / 2;
35
+ this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
36
+ this._heightOfProtrudingPart = SizeUtils.getOffsetHeight(this.rootElement) - this.controls.divisions.height / 2;
36
37
  }
37
38
  get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
38
39
  getRootClassName() { return this.modelData.settings.styles.leftIndent.className; }
39
40
  adjustByTop() {
40
- const mainElementHeight = this.rootElement.offsetHeight;
41
+ const mainElementHeight = SizeUtils.getOffsetHeight(this.rootElement);
41
42
  const divisionsControlHeight = this.controls.divisions.height;
42
43
  this.rootElement.style.marginTop = (mainElementHeight - divisionsControlHeight) / 2 + "px";
43
44
  }
@@ -4,6 +4,7 @@ import { Flag } from '@devexpress/utils/lib/class/flag';
4
4
  import { RulerControls } from './manager';
5
5
  import { RulerModelData } from './model-data';
6
6
  import { RulerVisibility } from './settings';
7
+ import { SizeUtils } from '../../../common/utils/size-utils';
7
8
  var HorizontalRulerEventType;
8
9
  (function (HorizontalRulerEventType) {
9
10
  HorizontalRulerEventType[HorizontalRulerEventType["None"] = 0] = "None";
@@ -190,7 +191,7 @@ export class HorizontalRulerControl extends BatchUpdatableObject {
190
191
  return this._visible;
191
192
  }
192
193
  getHeight() {
193
- return this.initialized ? this.controls.wrapper.rootElement.offsetHeight : 0;
194
+ return this.initialized ? SizeUtils.getOffsetHeight(this.controls.wrapper.rootElement) : 0;
194
195
  }
195
196
  onViewTypeChanged() {
196
197
  this.innerSetVisible(this._visible && !this.modelData.innerClientProperties.viewsSettings.isSimpleView);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import TrialPanel from 'devextreme/core/trial_panel';
2
+ TrialPanel.registerTrialPanelComponents();
@@ -1,4 +1,7 @@
1
1
  export declare class SizeUtils {
2
2
  static getClientWidth(element: Element): number;
3
3
  static getClientHeight(element: Element): number;
4
+ static getOffsetSize(element: Element): DOMRect;
5
+ static getOffsetWidth(element: Element): number;
6
+ static getOffsetHeight(element: Element): number;
4
7
  }
@@ -1,12 +1,25 @@
1
1
  export class SizeUtils {
2
2
  static getClientWidth(element) {
3
- const width = element.getBoundingClientRect().width;
4
3
  const style = getComputedStyle(element);
5
- return width - parseFloat(style.borderLeftWidth) - parseFloat(style.borderRightWidth) - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
4
+ const offset = parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth) + parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
5
+ const sizeWithScrollBar = SizeUtils.getOffsetWidth(element) - offset;
6
+ const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientWidth;
7
+ return sizeWithScrollBar - scrollBarSize;
6
8
  }
7
9
  static getClientHeight(element) {
8
- const width = element.getBoundingClientRect().height;
9
10
  const style = getComputedStyle(element);
10
- return width - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);
11
+ const offset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth) + parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
12
+ const sizeWithScrollBar = SizeUtils.getOffsetHeight(element) - offset;
13
+ const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientHeight;
14
+ return sizeWithScrollBar - scrollBarSize;
15
+ }
16
+ static getOffsetSize(element) {
17
+ return element.getBoundingClientRect();
18
+ }
19
+ static getOffsetWidth(element) {
20
+ return SizeUtils.getOffsetSize(element).width;
21
+ }
22
+ static getOffsetHeight(element) {
23
+ return SizeUtils.getOffsetSize(element).height;
11
24
  }
12
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devexpress-richedit",
3
- "version": "24.1.1-alpha-24085-0102",
3
+ "version": "24.1.3",
4
4
  "homepage": "https://www.devexpress.com/",
5
5
  "bugs": "https://www.devexpress.com/support/",
6
6
  "author": "Developer Express Inc.",
@@ -14,13 +14,13 @@
14
14
  "build-nspell": "webpack --mode production --config=bin/nspell.webpack.config.js"
15
15
  },
16
16
  "peerDependencies": {
17
- "devextreme": "24.1.1-alpha-24082-1039",
18
- "devextreme-dist": "24.1.1-alpha-24082-1039"
17
+ "devextreme": "24.1.3",
18
+ "devextreme-dist": "24.1.3"
19
19
  },
20
20
  "dependencies": {
21
21
  "jszip": "~3.10.1",
22
22
  "tslib": "2.6.0",
23
- "@devexpress/utils": "1.4.1"
23
+ "@devexpress/utils": "^1.4.3"
24
24
  },
25
25
  "devDependencies": {
26
26
  "webpack": "5.75.0",