devexpress-richedit 25.1.1-alpha → 25.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 (132) 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 +1 -1
  7. package/bin/webpack.config.js +1 -1
  8. package/dist/dx.richedit.css +1 -1
  9. package/dist/dx.richedit.d.ts +1 -2
  10. package/dist/dx.richedit.js +1732 -1362
  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/client-rich-edit.js +3 -3
  15. package/lib/client/commands/commands.js +0 -3
  16. package/lib/client/commands/mail-merge-command.js +2 -1
  17. package/lib/client/formats/docx/export/data.d.ts +5 -1
  18. package/lib/client/formats/docx/export/data.js +3 -2
  19. package/lib/client/formats/docx/export/exporter.d.ts +2 -3
  20. package/lib/client/formats/docx/export/exporter.js +3 -3
  21. package/lib/client/formats/docx/export/exporters/base/sections.d.ts +0 -1
  22. package/lib/client/formats/docx/export/exporters/base/sections.js +2 -10
  23. package/lib/client/formats/docx/export/exporters/base/table/table.d.ts +1 -1
  24. package/lib/client/formats/docx/export/exporters/base/table/table.js +4 -4
  25. package/lib/client/formats/docx/import/destination/paragraph-properties/properties/paragraph-spacing-destination.js +6 -4
  26. package/lib/client/model-api/character-properties.js +13 -17
  27. package/lib/client/model-api/document.js +2 -0
  28. package/lib/client/model-api/formats/exporter.js +2 -2
  29. package/lib/client/model-api/images/images.js +1 -1
  30. package/lib/client/model-api/sub-document.js +1 -1
  31. package/lib/client/public/commands/enum.d.ts +1 -2
  32. package/lib/client/public/commands/enum.js +0 -1
  33. package/lib/client/public/options.d.ts +1 -0
  34. package/lib/client/public/rich-edit.js +2 -2
  35. package/lib/client/utils/focus-helper.js +22 -5
  36. package/lib/common/canvas/canvas-manager.js +38 -24
  37. package/lib/common/canvas/canvas-scroll-info.d.ts +6 -3
  38. package/lib/common/canvas/canvas-scroll-info.js +9 -4
  39. package/lib/common/canvas/canvas-scroll-manager.d.ts +4 -1
  40. package/lib/common/canvas/canvas-scroll-manager.js +28 -20
  41. package/lib/common/canvas/canvas-size-info.d.ts +4 -2
  42. package/lib/common/canvas/canvas-size-info.js +3 -5
  43. package/lib/common/canvas/renderes/canvas-listener/print-layout-view-canvas-listener.js +2 -2
  44. package/lib/common/canvas/renderes/common/document-renderer.d.ts +4 -1
  45. package/lib/common/canvas/renderes/common/document-renderer.js +15 -12
  46. package/lib/common/canvas/renderes/view-manager.d.ts +5 -1
  47. package/lib/common/canvas/renderes/view-manager.js +16 -7
  48. package/lib/common/commands/client-command.d.ts +1 -2
  49. package/lib/common/commands/client-command.js +0 -1
  50. package/lib/common/commands/command-manager.js +0 -2
  51. package/lib/common/commands/document/print-document-on-client-command.d.ts +2 -0
  52. package/lib/common/commands/document/print-document-on-client-command.js +46 -18
  53. package/lib/common/commands/layout/apply-style-command.d.ts +2 -2
  54. package/lib/common/commands/layout/apply-style-command.js +3 -4
  55. package/lib/common/commands/toc/set-paragraph-level-command.js +1 -1
  56. package/lib/common/formats/i-document-exporter.d.ts +3 -0
  57. package/lib/common/formats/rtf/export/exporter.d.ts +2 -3
  58. package/lib/common/formats/rtf/export/exporter.js +3 -3
  59. package/lib/common/formats/rtf/export/exporters/rtf-content-exporter.d.ts +4 -2
  60. package/lib/common/formats/rtf/export/exporters/rtf-content-exporter.js +13 -9
  61. package/lib/common/formats/rtf/export/exporters/table/rtf-table-exporter.d.ts +3 -2
  62. package/lib/common/formats/rtf/export/exporters/table/rtf-table-exporter.js +4 -4
  63. package/lib/common/formats/rtf/export/exporters/table/states/rtf-nested-table-exporter-state.d.ts +2 -1
  64. package/lib/common/formats/rtf/export/exporters/table/states/rtf-nested-table-exporter-state.js +2 -2
  65. package/lib/common/formats/rtf/export/exporters/table/states/rtf-table-exporter-state-base.d.ts +4 -2
  66. package/lib/common/formats/rtf/export/exporters/table/states/rtf-table-exporter-state-base.js +16 -9
  67. package/lib/common/formats/rtf/export/exporters/table/states/rtf-table-exporter-state.d.ts +2 -1
  68. package/lib/common/formats/rtf/export/exporters/table/states/rtf-table-exporter-state.js +2 -2
  69. package/lib/common/formats/rtf/import/table/normalization/apply-use-values.d.ts +6 -0
  70. package/lib/common/formats/rtf/import/table/normalization/apply-use-values.js +90 -0
  71. package/lib/common/formats/rtf/import/table/table-converter.js +7 -2
  72. package/lib/common/formats/rtf/importer-in-subdocument.d.ts +1 -2
  73. package/lib/common/formats/rtf/importer-in-subdocument.js +4 -3
  74. package/lib/common/input-controller.d.ts +5 -5
  75. package/lib/common/input-controller.js +16 -12
  76. package/lib/common/layout/document-layout.d.ts +5 -0
  77. package/lib/common/layout/document-layout.js +13 -0
  78. package/lib/common/layout/main-structures/layout-page-area.d.ts +3 -0
  79. package/lib/common/layout/main-structures/layout-page-area.js +6 -0
  80. package/lib/common/layout/main-structures/layout-page.d.ts +3 -0
  81. package/lib/common/layout/main-structures/layout-page.js +8 -0
  82. package/lib/common/layout/main-structures/layout-row.js +1 -2
  83. package/lib/common/layout-formatter/floating/position-calculators/horizontal.d.ts +1 -0
  84. package/lib/common/layout-formatter/floating/position-calculators/horizontal.js +16 -12
  85. package/lib/common/layout-formatter/row/size-engine/row-formatting-info.d.ts +4 -1
  86. package/lib/common/layout-formatter/row/size-engine/row-formatting-info.js +36 -2
  87. package/lib/common/layout-formatter/row/states.js +0 -2
  88. package/lib/common/layout-formatter/row/tab-info.js +5 -4
  89. package/lib/common/layout-formatter/row/word-holder.js +1 -1
  90. package/lib/common/layout-formatter/table/info/table-info.d.ts +0 -1
  91. package/lib/common/layout-formatter/table/info/table-info.js +2 -18
  92. package/lib/common/layout-formatter/table/size-compressor.js +9 -2
  93. package/lib/common/layout-formatter/table/table-alignment-applier.js +0 -2
  94. package/lib/common/model/borders/border-info.js +1 -1
  95. package/lib/common/model/caches/images.d.ts +4 -1
  96. package/lib/common/model/caches/images.js +6 -2
  97. package/lib/common/model/changes/change.d.ts +2 -1
  98. package/lib/common/model/changes/enums.d.ts +2 -1
  99. package/lib/common/model/changes/enums.js +1 -0
  100. package/lib/common/model/changes/model/zoom-level.d.ts +8 -0
  101. package/lib/common/model/changes/model/zoom-level.js +8 -0
  102. package/lib/common/model/character/character-properties.d.ts +1 -1
  103. package/lib/common/model/character/character-properties.js +14 -2
  104. package/lib/common/model/creator/creator.js +6 -0
  105. package/lib/common/model/fields/field.d.ts +1 -1
  106. package/lib/common/model/fields/field.js +4 -3
  107. package/lib/common/model/fields/tree-creator.js +1 -1
  108. package/lib/common/model/history/items/character-properties-history-items.d.ts +2 -1
  109. package/lib/common/model/history/items/character-properties-history-items.js +3 -2
  110. package/lib/common/model/manipulators/character-properties-manipulator.js +2 -2
  111. package/lib/common/model/manipulators/i-properties-manipulator.d.ts +1 -1
  112. package/lib/common/model/manipulators/model-manipulator.d.ts +2 -1
  113. package/lib/common/model/manipulators/model-manipulator.js +4 -0
  114. package/lib/common/model/manipulators/picture-manipulator/picture-manipulator.js +2 -2
  115. package/lib/common/model/options/fonts.d.ts +1 -1
  116. package/lib/common/model/paragraph/paragraph-style.d.ts +2 -1
  117. package/lib/common/model/paragraph/paragraph-style.js +2 -1
  118. package/lib/common/model/tables/secondary-structures/table-base-structures.d.ts +2 -1
  119. package/lib/common/model/tables/secondary-structures/table-base-structures.js +1 -0
  120. package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.d.ts +1 -1
  121. package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.js +22 -25
  122. package/lib/common/rich-edit-core.js +18 -18
  123. package/lib/common/ui/ruler/controls/ruler.js +3 -7
  124. package/lib/common/ui/ruler/controls/vertical-line.js +2 -1
  125. package/lib/common/ui/ruler/ruler.js +2 -0
  126. package/lib/common/utils/mixed-size.d.ts +27 -0
  127. package/lib/common/utils/mixed-size.js +91 -0
  128. package/lib/common/utils/size-utils.d.ts +14 -7
  129. package/lib/common/utils/size-utils.js +43 -18
  130. package/package.json +3 -3
  131. package/lib/common/commands/layout/toggle-allow-zoom-command.d.ts +0 -7
  132. package/lib/common/commands/layout/toggle-allow-zoom-command.js +0 -17
@@ -37,17 +37,18 @@ import { RtfTableExporter } from './table/rtf-table-exporter';
37
37
  export class RtfContentExporter {
38
38
  get shouldExportHiddenText() { return true; }
39
39
  ;
40
- constructor(documentModel, options, rtfExportHelper) {
40
+ get documentModel() { return this.exportModelOptions.modelManager.modelManipulator.model; }
41
+ constructor(exportModelOptions, options, rtfExportHelper) {
41
42
  this.shouldFourceUpdateIterators = false;
42
- this.documentModel = documentModel;
43
+ this.exportModelOptions = exportModelOptions;
43
44
  this.subDocument = this.documentModel.mainSubDocument;
44
45
  this.pieceTableNumberingListCounters = new PieceTableNumberingListCountersManager();
45
46
  this.rtfExportHelper = rtfExportHelper;
46
47
  this.options = options;
47
48
  this.rtfBuilder = this.createRtfBuilder();
48
- this.paragraphPropertiesExporter = new RtfParagraphPropertiesExporter(documentModel, rtfExportHelper, this.rtfBuilder);
49
- this.characterPropertiesExporter = new RtfCharacterPropertiesExporter(documentModel, rtfExportHelper, this.rtfBuilder, options);
50
- this.sectionPropertiesExporter = new RtfSectionPropertiesExporter(documentModel, rtfExportHelper, this.rtfBuilder);
49
+ this.paragraphPropertiesExporter = new RtfParagraphPropertiesExporter(this.documentModel, rtfExportHelper, this.rtfBuilder);
50
+ this.characterPropertiesExporter = new RtfCharacterPropertiesExporter(this.documentModel, rtfExportHelper, this.rtfBuilder, options);
51
+ this.sectionPropertiesExporter = new RtfSectionPropertiesExporter(this.documentModel, rtfExportHelper, this.rtfBuilder);
51
52
  this.runHandlerMap = new MapCreator()
52
53
  .add(RunType.TextRun, this.exportTextRun)
53
54
  .add(RunType.FieldCodeStartRun, this.fieldCodeStartRunHandler)
@@ -257,7 +258,7 @@ export class RtfContentExporter {
257
258
  value = "00000000";
258
259
  }
259
260
  else {
260
- const view = new DataView(hash, 0);
261
+ const view = new DataView(hash.buffer, 0);
261
262
  const hashValue = view.getInt32(0);
262
263
  value = this.documentModel.simpleFormattersManager.formatString("{0:x8}", hashValue);
263
264
  }
@@ -433,11 +434,14 @@ export class RtfContentExporter {
433
434
  this.exportSingleParagraph(paragraph);
434
435
  return paragraphIndex;
435
436
  }
436
- else
437
- return RtfTableExporter.exportTable(this, tablesInfo[0].table.getTopLevelParent()) - this.startSectionParagraphIndex;
437
+ else {
438
+ const table = tablesInfo[0].table.getTopLevelParent();
439
+ const grid = this.exportModelOptions.grids.get(table);
440
+ return RtfTableExporter.exportTable(this, table, grid) - this.startSectionParagraphIndex;
441
+ }
438
442
  }
439
443
  exportSingleParagraph(paragraph) {
440
- this.exportParagraphCore(paragraph, 0, 0, -1);
444
+ this.exportParagraphCore(paragraph, 0, ConditionalTableStyleFormatting.None, -1);
441
445
  this.finishParagraph(paragraph);
442
446
  }
443
447
  finishParagraph(paragraph) {
@@ -1,6 +1,7 @@
1
+ import { Grid } from '../../../../../layout-formatter/table/grid-engine/grid';
1
2
  import { Table } from '../../../../../model/tables/main-structures/table';
2
3
  import { RtfContentExporter } from '../rtf-content-exporter';
3
4
  export declare class RtfTableExporter {
4
- static exportTable(rtfContentExporter: RtfContentExporter, table: Table): number;
5
- static exportNestedTable(rtfContentExporter: RtfContentExporter, table: Table, nestingLevel: number): number;
5
+ static exportTable(rtfContentExporter: RtfContentExporter, table: Table, grid: Grid): number;
6
+ static exportNestedTable(rtfContentExporter: RtfContentExporter, table: Table, grid: Grid, nestingLevel: number): number;
6
7
  }
@@ -1,13 +1,13 @@
1
1
  import { RtfNestedTableExporterState } from './states/rtf-nested-table-exporter-state';
2
2
  import { RtfTableExporterState } from './states/rtf-table-exporter-state';
3
3
  export class RtfTableExporter {
4
- static exportTable(rtfContentExporter, table) {
5
- new RtfTableExporterState(rtfContentExporter, table).export();
4
+ static exportTable(rtfContentExporter, table, grid) {
5
+ new RtfTableExporterState(rtfContentExporter, table, grid).export();
6
6
  rtfContentExporter.tableIterator.update(table.getEndPosition());
7
7
  return rtfContentExporter.subDocument.getParagraphIndexByPosition(table.getEndPosition() - 1);
8
8
  }
9
- static exportNestedTable(rtfContentExporter, table, nestingLevel) {
10
- new RtfNestedTableExporterState(rtfContentExporter, table, nestingLevel).export();
9
+ static exportNestedTable(rtfContentExporter, table, grid, nestingLevel) {
10
+ new RtfNestedTableExporterState(rtfContentExporter, table, grid, nestingLevel).export();
11
11
  rtfContentExporter.tableIterator.update(table.getEndPosition());
12
12
  return rtfContentExporter.subDocument.getParagraphIndexByPosition(table.getEndPosition() - 1);
13
13
  }
@@ -1,9 +1,10 @@
1
+ import { Grid } from '../../../../../../layout-formatter/table/grid-engine/grid';
1
2
  import { Table } from '../../../../../../model/tables/main-structures/table';
2
3
  import { TableRow } from '../../../../../../model/tables/main-structures/table-row';
3
4
  import { RtfContentExporter } from '../../rtf-content-exporter';
4
5
  import { RtfTableExporterStateBase } from './rtf-table-exporter-state-base';
5
6
  export declare class RtfNestedTableExporterState extends RtfTableExporterStateBase {
6
- constructor(rtfExporter: RtfContentExporter, table: Table, nestingLevel: number);
7
+ constructor(rtfExporter: RtfContentExporter, table: Table, grid: Grid, nestingLevel: number);
7
8
  export(): void;
8
9
  protected writeParagraphEndMark(): void;
9
10
  protected exportRow(row: TableRow, rowIndex: number): void;
@@ -1,8 +1,8 @@
1
1
  import { RtfExportSR } from '../../../../translation-table/rtf-export-sr';
2
2
  import { RtfTableExporterStateBase } from './rtf-table-exporter-state-base';
3
3
  export class RtfNestedTableExporterState extends RtfTableExporterStateBase {
4
- constructor(rtfExporter, table, nestingLevel) {
5
- super(rtfExporter, table, nestingLevel);
4
+ constructor(rtfExporter, table, grid, nestingLevel) {
5
+ super(rtfExporter, table, grid, nestingLevel);
6
6
  }
7
7
  export() {
8
8
  super.exportBase();
@@ -6,6 +6,7 @@ import { TableCell } from '../../../../../../model/tables/main-structures/table-
6
6
  import { TableRow } from '../../../../../../model/tables/main-structures/table-row';
7
7
  import { ConditionalTableStyleFormatting } from '../../../../../../model/tables/secondary-structures/table-base-structures';
8
8
  import { TableWidthUnit } from '../../../../../../model/tables/secondary-structures/table-units';
9
+ import { Grid } from '../../../../../../layout-formatter/table/grid-engine/grid';
9
10
  import { RtfBuilder } from '../../../rtf-builder';
10
11
  import { RtfContentExporter } from '../../rtf-content-exporter';
11
12
  import { RtfTableCellPropertiesExporter } from '../rtf-table-cell-properties-exporter';
@@ -17,10 +18,11 @@ export declare abstract class RtfTableExporterStateBase {
17
18
  tableStyleIndex: number;
18
19
  rowLeftOffset: number;
19
20
  readonly table: Table;
21
+ readonly grid: Grid;
20
22
  readonly tableRowPropertiesExporter: RtfTableRowPropertiesExporter;
21
23
  readonly tableCellPropertiesExporter: RtfTableCellPropertiesExporter;
22
24
  readonly tablePropertiesExporter: RtfTablePropertiesExporter;
23
- protected constructor(rtfExporter: RtfContentExporter, table: Table, nestingLevel: number);
25
+ protected constructor(rtfExporter: RtfContentExporter, table: Table, grid: Grid, nestingLevel: number);
24
26
  protected get rtfBuilder(): RtfBuilder;
25
27
  protected get documentModel(): DocumentModel;
26
28
  protected get subDocument(): SubDocument;
@@ -36,7 +38,7 @@ export declare abstract class RtfTableExporterStateBase {
36
38
  protected abstract exportRow(row: TableRow, rowIndex: number): void;
37
39
  protected abstract writeParagraphEndMark(): void;
38
40
  exportRowProperties(row: TableRow, rowIndex: number): void;
39
- getCellWidth(virtualColumnIndex: number): number;
41
+ getCellWidth(leftSideIndex: number, columnSpan: number): number;
40
42
  calculateRowLeft(row: TableRow, indent: TableWidthUnit): number;
41
43
  protected calculateRowLeftOffset(row: TableRow): number;
42
44
  getActualWidth(unit: TableWidthUnit): number;
@@ -4,6 +4,7 @@ import { TableCellMergingState, TableLookTypes } from '../../../../../../model/t
4
4
  import { TableWidthUnitType } from '../../../../../../model/tables/secondary-structures/table-units';
5
5
  import { Errors } from '@devexpress/utils/lib/errors';
6
6
  import { ListUtils } from '@devexpress/utils/lib/utils/list';
7
+ import { UnitConverter } from '@devexpress/utils/lib/class/unit-converter';
7
8
  import { RtfExportSR } from '../../../../translation-table/rtf-export-sr';
8
9
  import { RtfTableCellPropertiesMerger } from '../../../../utils/mergers/rtf-table-cell-properties-merger';
9
10
  import { RtfTablePropertiesMerger } from '../../../../utils/mergers/rtf-table-properties-merger';
@@ -14,10 +15,11 @@ import { RtfTableExporter } from '../rtf-table-exporter';
14
15
  import { RtfTablePropertiesExporter } from '../rtf-table-properties-exporter';
15
16
  import { RtfTableRowPropertiesExporter } from '../rtf-table-row-properties-exporter';
16
17
  export class RtfTableExporterStateBase {
17
- constructor(rtfExporter, table, nestingLevel) {
18
+ constructor(rtfExporter, table, grid, nestingLevel) {
18
19
  this.rtfExporter = rtfExporter;
19
20
  this._nestingLevel = nestingLevel;
20
21
  this.table = table;
22
+ this.grid = grid;
21
23
  this.tableRowPropertiesExporter = new RtfTableRowPropertiesExporter(rtfExporter.documentModel, rtfExporter.rtfExportHelper, rtfExporter.rtfBuilder);
22
24
  this.tableCellPropertiesExporter = new RtfTableCellPropertiesExporter(rtfExporter.documentModel, rtfExporter.rtfExportHelper, rtfExporter.rtfBuilder);
23
25
  this.tablePropertiesExporter = new RtfTablePropertiesExporter(rtfExporter.documentModel, rtfExporter.rtfExportHelper, rtfExporter.rtfBuilder);
@@ -92,7 +94,7 @@ export class RtfTableExporterStateBase {
92
94
  while (parentCell !== nestedTable.parentCell) {
93
95
  nestedTable = nestedTable.parentCell.parentRow.parentTable;
94
96
  }
95
- return RtfTableExporter.exportNestedTable(this.rtfExporter, nestedTable, this.nestingLevel + 1);
97
+ return RtfTableExporter.exportNestedTable(this.rtfExporter, nestedTable, this.grid, this.nestingLevel + 1);
96
98
  }
97
99
  exportRowProperties(row, rowIndex) {
98
100
  const rowLeft = this.calculateRowLeft(row, row.parentTable.getActualTableIndent(this.documentModel.defaultTableProperties));
@@ -100,20 +102,25 @@ export class RtfTableExporterStateBase {
100
102
  let cellRightVirtualColInd = row.gridBefore;
101
103
  for (const cell of row.cells) {
102
104
  cellRightVirtualColInd += cell.columnSpan;
103
- const cellRight = rowLeft + this.getCellWidth(cellRightVirtualColInd);
105
+ const cellWidth = this.getCellWidth(row.gridBefore, cellRightVirtualColInd);
106
+ const cellRight = UnitConverter.pixelsToTwips(rowLeft + cellWidth);
104
107
  this.exportCellProperties(cell, cellRight);
105
108
  }
106
109
  }
107
- getCellWidth(virtualColumnIndex) {
108
- if (virtualColumnIndex < 0)
110
+ getCellWidth(leftSideIndex, columnSpan) {
111
+ if (leftSideIndex < 0 || columnSpan < 0)
109
112
  throw new Error(Errors.InternalException);
110
- const minVirtualColumnWidth = 10;
111
- return virtualColumnIndex * minVirtualColumnWidth;
113
+ let result = 0;
114
+ for (let i = 0; i < columnSpan; i++)
115
+ result += Math.max(this.grid.columns.width[i + leftSideIndex], 1);
116
+ return result;
112
117
  }
113
118
  calculateRowLeft(row, indent) {
114
- const widthBefore = row.gridBefore > 0 ? this.getCellWidth(row.gridBefore) : 0;
119
+ var _a;
120
+ const widthBefore = row.gridBefore > 0 ? this.getCellWidth(0, row.gridBefore) : 0;
115
121
  const offset = this.getActualWidth(indent) + widthBefore;
116
- return offset - (this.rowLeftOffset != null ? this.rowLeftOffset : this.calculateRowLeftOffset(row));
122
+ const rowLeftOffset = (_a = this.rowLeftOffset) !== null && _a !== void 0 ? _a : this.calculateRowLeftOffset(row);
123
+ return offset - rowLeftOffset;
117
124
  }
118
125
  calculateRowLeftOffset(row) {
119
126
  const borderWidth = row.cells[0].properties.borders.left.width;
@@ -1,9 +1,10 @@
1
+ import { Grid } from '../../../../../../layout-formatter/table/grid-engine/grid';
1
2
  import { Table } from '../../../../../../model/tables/main-structures/table';
2
3
  import { TableRow } from '../../../../../../model/tables/main-structures/table-row';
3
4
  import { RtfContentExporter } from '../../rtf-content-exporter';
4
5
  import { RtfTableExporterStateBase } from './rtf-table-exporter-state-base';
5
6
  export declare class RtfTableExporterState extends RtfTableExporterStateBase {
6
- constructor(rtfExporter: RtfContentExporter, table: Table);
7
+ constructor(rtfExporter: RtfContentExporter, table: Table, grid: Grid);
7
8
  export(): void;
8
9
  protected writeParagraphEndMark(): void;
9
10
  protected exportRow(row: TableRow, rowIndex: number): void;
@@ -1,8 +1,8 @@
1
1
  import { RtfExportSR } from '../../../../translation-table/rtf-export-sr';
2
2
  import { RtfTableExporterStateBase } from './rtf-table-exporter-state-base';
3
3
  export class RtfTableExporterState extends RtfTableExporterStateBase {
4
- constructor(rtfExporter, table) {
5
- super(rtfExporter, table, 1);
4
+ constructor(rtfExporter, table, grid) {
5
+ super(rtfExporter, table, grid, 1);
6
6
  }
7
7
  export() {
8
8
  super.exportBase();
@@ -0,0 +1,6 @@
1
+ import { TableCellProperties } from '../../../../../model/tables/properties/table-cell-properties';
2
+ import { TableProperties } from '../../../../../model/tables/properties/table-properties';
3
+ import { TableRowProperties } from '../../../../../model/tables/properties/table-row-properties';
4
+ export declare function applyTablePropertiesUseValues(props: TableProperties, styleProps: TableProperties): void;
5
+ export declare function applyTableRowPropertiesUseValues(props: TableRowProperties, styleProps: TableRowProperties): void;
6
+ export declare function applyTableCellPropertiesUseValues(props: TableCellProperties, styleProps: TableCellProperties): void;
@@ -0,0 +1,90 @@
1
+ import { TableCellPropertiesMask } from '../../../../../model/tables/properties/table-cell-properties';
2
+ import { TablePropertiesMask } from '../../../../../model/tables/properties/table-properties';
3
+ import { TableRowPropertiesMask } from '../../../../../model/tables/properties/table-row-properties';
4
+ export function applyTablePropertiesUseValues(props, styleProps) {
5
+ props.mask = TablePropertiesMask.UseNone;
6
+ if (!props.borders.left.equals(styleProps.borders.left))
7
+ props.setUseValue(TablePropertiesMask.UseLeftBorder, true);
8
+ if (!props.borders.top.equals(styleProps.borders.top))
9
+ props.setUseValue(TablePropertiesMask.UseTopBorder, true);
10
+ if (!props.borders.right.equals(styleProps.borders.right))
11
+ props.setUseValue(TablePropertiesMask.UseRightBorder, true);
12
+ if (!props.borders.bottom.equals(styleProps.borders.bottom))
13
+ props.setUseValue(TablePropertiesMask.UseBottomBorder, true);
14
+ if (!props.borders.insideHorizontal.equals(styleProps.borders.insideHorizontal))
15
+ props.setUseValue(TablePropertiesMask.UseInsideHorizontalBorder, true);
16
+ if (!props.borders.insideVertical.equals(styleProps.borders.insideVertical))
17
+ props.setUseValue(TablePropertiesMask.UseInsideVerticalBorder, true);
18
+ if (!props.cellMargins.left.equals(styleProps.cellMargins.left))
19
+ props.setUseValue(TablePropertiesMask.UseLeftMargin, true);
20
+ if (!props.cellMargins.top.equals(styleProps.cellMargins.top))
21
+ props.setUseValue(TablePropertiesMask.UseTopMargin, true);
22
+ if (!props.cellMargins.right.equals(styleProps.cellMargins.right))
23
+ props.setUseValue(TablePropertiesMask.UseRightMargin, true);
24
+ if (!props.cellMargins.bottom.equals(styleProps.cellMargins.bottom))
25
+ props.setUseValue(TablePropertiesMask.UseBottomMargin, true);
26
+ if (!props.cellSpacing.equals(styleProps.cellSpacing))
27
+ props.setUseValue(TablePropertiesMask.UseCellSpacing, true);
28
+ if (!props.indent.equals(styleProps.indent))
29
+ props.setUseValue(TablePropertiesMask.UseTableIndent, true);
30
+ if (props.tableStyleColumnBandSize != styleProps.tableStyleColumnBandSize)
31
+ props.setUseValue(TablePropertiesMask.UseTableStyleColBandSize, true);
32
+ if (props.tableStyleRowBandSize != styleProps.tableStyleRowBandSize)
33
+ props.setUseValue(TablePropertiesMask.UseTableStyleRowBandSize, true);
34
+ if (props.avoidDoubleBorders != styleProps.avoidDoubleBorders)
35
+ props.setUseValue(TablePropertiesMask.UseAvoidDoubleBorders, true);
36
+ if (props.layoutType != styleProps.layoutType)
37
+ props.setUseValue(TablePropertiesMask.UseTableLayout, true);
38
+ if (!props.shadingInfo.equals(styleProps.shadingInfo))
39
+ props.setUseValue(TablePropertiesMask.UseShadingInfoIndex, true);
40
+ if (props.tableRowAlignment != styleProps.tableRowAlignment)
41
+ props.setUseValue(TablePropertiesMask.UseTableAlignment, true);
42
+ if (props.isTableOverlap != styleProps.isTableOverlap)
43
+ props.setUseValue(TablePropertiesMask.UseIsTableOverlap, true);
44
+ }
45
+ export function applyTableRowPropertiesUseValues(props, styleProps) {
46
+ props.mask = TableRowPropertiesMask.UseNone;
47
+ if (!props.cellSpacing.equals(styleProps.cellSpacing))
48
+ props.setUseValue(TableRowPropertiesMask.UseCellSpacing, true);
49
+ if (props.cantSplit != styleProps.cantSplit)
50
+ props.setUseValue(TableRowPropertiesMask.UseCantSplit, true);
51
+ if (props.hideCellMark != styleProps.hideCellMark)
52
+ props.setUseValue(TableRowPropertiesMask.UseHideCellMark, true);
53
+ if (props.tableRowAlignment != styleProps.tableRowAlignment)
54
+ props.setUseValue(TableRowPropertiesMask.UseTableRowAlignment, true);
55
+ if (props.header != styleProps.header)
56
+ props.setUseValue(TableRowPropertiesMask.UseHeader, true);
57
+ if (props.divId != styleProps.divId)
58
+ props.setUseValue(TableRowPropertiesMask.UseDivId, true);
59
+ }
60
+ export function applyTableCellPropertiesUseValues(props, styleProps) {
61
+ props.mask = TableCellPropertiesMask.UseNone;
62
+ if (!props.cellMargins.left.equals(styleProps.cellMargins.left))
63
+ props.setUseValue(TableCellPropertiesMask.UseLeftMargin, true);
64
+ if (!props.cellMargins.top.equals(styleProps.cellMargins.top))
65
+ props.setUseValue(TableCellPropertiesMask.UseTopMargin, true);
66
+ if (!props.cellMargins.bottom.equals(styleProps.cellMargins.bottom))
67
+ props.setUseValue(TableCellPropertiesMask.UseBottomMargin, true);
68
+ if (!props.cellMargins.right.equals(styleProps.cellMargins.right))
69
+ props.setUseValue(TableCellPropertiesMask.UseRightMargin, true);
70
+ if (!props.borders.left.equals(styleProps.borders.left))
71
+ props.setUseValue(TableCellPropertiesMask.UseLeftBorder, true);
72
+ if (!props.borders.top.equals(styleProps.borders.top))
73
+ props.setUseValue(TableCellPropertiesMask.UseTopBorder, true);
74
+ if (!props.borders.bottom.equals(styleProps.borders.bottom))
75
+ props.setUseValue(TableCellPropertiesMask.UseBottomBorder, true);
76
+ if (!props.borders.right.equals(styleProps.borders.right))
77
+ props.setUseValue(TableCellPropertiesMask.UseRightBorder, true);
78
+ if (props.hideCellMark != styleProps.hideCellMark)
79
+ props.setUseValue(TableCellPropertiesMask.UseHideCellMark, true);
80
+ if (props.noWrap != styleProps.noWrap)
81
+ props.setUseValue(TableCellPropertiesMask.UseNoWrap, true);
82
+ if (props.fitText != styleProps.fitText)
83
+ props.setUseValue(TableCellPropertiesMask.UseFitText, true);
84
+ if (props.textDirection != styleProps.textDirection)
85
+ props.setUseValue(TableCellPropertiesMask.UseTextDirection, true);
86
+ if (props.verticalAlignment != styleProps.verticalAlignment)
87
+ props.setUseValue(TableCellPropertiesMask.UseVerticalAlignment, true);
88
+ if (!props.shadingInfo.equals(styleProps.shadingInfo))
89
+ props.setUseValue(TableCellPropertiesMask.UseShadingInfoIndex, true);
90
+ }
@@ -7,6 +7,7 @@ import { ListUtils } from '@devexpress/utils/lib/utils/list';
7
7
  import { NumberMapUtils } from '@devexpress/utils/lib/utils/map/number';
8
8
  import { RtfTableColumnsCalculator } from './rtf-table-columns-calculator';
9
9
  import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
10
+ import { applyTableCellPropertiesUseValues, applyTablePropertiesUseValues, applyTableRowPropertiesUseValues } from './normalization/apply-use-values';
10
11
  export class RtfTableConverter {
11
12
  constructor(tableReader) {
12
13
  this.rtfCellMap = {};
@@ -54,8 +55,9 @@ export class RtfTableConverter {
54
55
  tablePreferredWidth.type = TableWidthUnitType.Auto;
55
56
  tablePreferredWidth.value = 0;
56
57
  }
57
- if (!table.properties.coreProperties.getUseValue(TablePropertiesMask.UseRightMargin) &&
58
- !table.properties.coreProperties.getUseValue(TablePropertiesMask.UseLeftMargin) && table.properties.useHalfSpace) {
58
+ const useMargins = table.properties.coreProperties.getUseValue(TablePropertiesMask.UseLeftMargin) &&
59
+ table.properties.coreProperties.getUseValue(TablePropertiesMask.UseRightMargin);
60
+ if (!useMargins && table.properties.useHalfSpace) {
59
61
  const margin = table.properties.halfSpace;
60
62
  table.properties.coreProperties.cellMargins.left.type = TableWidthUnitType.ModelUnits;
61
63
  table.properties.coreProperties.cellMargins.left.value = margin;
@@ -99,6 +101,7 @@ export class RtfTableConverter {
99
101
  return 0;
100
102
  }
101
103
  convertTableCore(table, rtfTable) {
104
+ applyTablePropertiesUseValues(table.properties, table.style.baseConditionalStyle.tableProperties);
102
105
  const tableGrid = this.calculateTableGrid(rtfTable);
103
106
  const rows = table.rows;
104
107
  const tableLayoutType = table.properties.layoutType;
@@ -201,6 +204,7 @@ export class RtfTableConverter {
201
204
  return result;
202
205
  }
203
206
  convertRow(row, rtfRow) {
207
+ applyTableRowPropertiesUseValues(row.properties, row.parentTable.style.baseConditionalStyle.tableRowProperties);
204
208
  const rtfCells = rtfRow.cells;
205
209
  for (let i = 0; i < rtfCells.length; i++)
206
210
  this.convertCell(row, rtfCells[i]);
@@ -209,6 +213,7 @@ export class RtfTableConverter {
209
213
  if (rtfCell.properties.horizontalMerging == TableCellMergingState.Restart)
210
214
  this.mergeCells(rtfCell);
211
215
  const cell = rtfCell.createCell(row, this.subDocument);
216
+ applyTableCellPropertiesUseValues(cell.properties, cell.parentRow.parentTable.style.baseConditionalStyle.tableCellProperties);
212
217
  row.cells.push(cell);
213
218
  this.rtfCellMap[rtfCell.idForParentCellMap] = cell;
214
219
  }
@@ -1,6 +1,5 @@
1
1
  import { FixedInterval } from "@devexpress/utils/lib/intervals/fixed";
2
- import { RichOptions } from "../../model/options/rich-options";
3
2
  import { SubDocument } from "../../model/sub-document";
4
3
  import { IProcessor } from "../../processor";
5
- export declare function getRtfFromSubDocumentPublic(richOptions: RichOptions, subDocument: SubDocument, coreInterval: FixedInterval): string;
4
+ export declare function getRtfFromSubDocumentPublic(processor: IProcessor, subDocument: SubDocument, coreInterval: FixedInterval): string;
6
5
  export declare function insertRtfInSubDocumentPublic(processor: IProcessor, subDocument: SubDocument, position: number, rtf: string, callback: (interval: FixedInterval, isRtfValid: boolean) => void): void;
@@ -7,10 +7,11 @@ import { RtfDocumentExporterOptions } from "./export/rtf-document-exporter-optio
7
7
  import { RtfImporterOptions } from "./import/importer-options";
8
8
  import { RtfImporter } from "./import/rtf-importer";
9
9
  import { getAfterInsertCallback, getAfterInsertReject } from "../callback-helpers";
10
- export function getRtfFromSubDocumentPublic(richOptions, subDocument, coreInterval) {
10
+ export function getRtfFromSubDocumentPublic(processor, subDocument, coreInterval) {
11
11
  const rangeCopy = RangeCopy.create(new SubDocumentIntervals(subDocument, [coreInterval]));
12
- const newModelManager = new ClientModelManager(rangeCopy.model, richOptions, new EmptyBatchUpdatableObject());
13
- return new RtfExporter(newModelManager.modelManipulator, new RtfDocumentExporterOptions()).exportAsString();
12
+ const newModelManager = new ClientModelManager(rangeCopy.model, processor.modelManager.richOptions, new EmptyBatchUpdatableObject());
13
+ const exportModelOptions = processor.getExportModelOptions({ modelManager: newModelManager });
14
+ return new RtfExporter(exportModelOptions, new RtfDocumentExporterOptions()).exportAsString();
14
15
  }
15
16
  export function insertRtfInSubDocumentPublic(processor, subDocument, position, rtf, callback) {
16
17
  const options = new RtfImporterOptions(() => { });
@@ -17,7 +17,7 @@ export declare abstract class InputEditorBase<TInpElement extends HTMLElement> {
17
17
  previousText: string;
18
18
  canInsertTextOnInputEvent: boolean;
19
19
  needProcessShortcut: boolean;
20
- initializedIfNotReadOnly: boolean;
20
+ editableStateInitialized: boolean;
21
21
  prevKeyCode: number;
22
22
  IMEState: IMEState;
23
23
  private inputWithAlt;
@@ -31,8 +31,8 @@ export declare abstract class InputEditorBase<TInpElement extends HTMLElement> {
31
31
  constructor(control: IRichEditControl, eventManager: IEventManager, parent: HTMLElement);
32
32
  dispose(): void;
33
33
  initialize(): void;
34
- initializeIfNotReadOnly(): void;
35
- initializeIfNotReadOnlyCore(): void;
34
+ initializeEditableState(): void;
35
+ initializeEditableStateCore(): void;
36
36
  initEvents(): void;
37
37
  createHierarchy(parent: HTMLElement): void;
38
38
  createHierarchyCore(): void;
@@ -78,7 +78,7 @@ export declare class DivInputEditor extends InputEditorBase<HTMLElement> {
78
78
  private onTextInputTimerId;
79
79
  constructor(control: IRichEditControl, eventManager: IEventManager, parent: HTMLElement);
80
80
  dispose(): void;
81
- initializeIfNotReadOnlyCore(): void;
81
+ initializeEditableStateCore(): void;
82
82
  setPosition(left: number, top: number): void;
83
83
  createInputElement(): HTMLElement;
84
84
  initEvents(): void;
@@ -114,7 +114,7 @@ export declare class IFrameInputEditor extends InputEditorBase<HTMLIFrameElement
114
114
  constructor(control: IRichEditControl, eventManager: IEventManager, parent: HTMLElement);
115
115
  dispose(): void;
116
116
  createHierarchyCore(): void;
117
- initializeIfNotReadOnlyCore(): void;
117
+ initializeEditableStateCore(): void;
118
118
  createInputElement(): HTMLIFrameElement;
119
119
  initEvents(): void;
120
120
  private isModifyEnabled;
@@ -51,17 +51,17 @@ export class InputEditorBase {
51
51
  clearTimeout(this.onKeyUpTimerId);
52
52
  }
53
53
  initialize() {
54
- this.initializeIfNotReadOnly();
54
+ this.initializeEditableState();
55
55
  this.initEvents();
56
56
  this.prevKeyCode = EMPTY_KEYCODE;
57
57
  }
58
- initializeIfNotReadOnly() {
59
- if ((this.control.readOnly !== ReadOnlyMode.Persistent || this.control.modelManager.clientMode) && !this.initializedIfNotReadOnly) {
60
- this.initializedIfNotReadOnly = true;
61
- this.initializeIfNotReadOnlyCore();
58
+ initializeEditableState() {
59
+ if (!this.editableStateInitialized) {
60
+ this.editableStateInitialized = true;
61
+ this.initializeEditableStateCore();
62
62
  }
63
63
  }
64
- initializeIfNotReadOnlyCore() {
64
+ initializeEditableStateCore() {
65
65
  }
66
66
  initEvents() {
67
67
  this.evtHandlersHolder.addListener(this.getEditableDocument(), "keydown", this.onKeyDown.bind(this));
@@ -281,8 +281,8 @@ export class DivInputEditor extends InputEditorBase {
281
281
  clearTimeout(this.composEndTimerId);
282
282
  clearTimeout(this.onTextInputTimerId);
283
283
  }
284
- initializeIfNotReadOnlyCore() {
285
- this.inputElement.contentEditable = "true";
284
+ initializeEditableStateCore() {
285
+ this.inputElement.contentEditable = String(!this.control.isReadOnlyPersistent);
286
286
  this.clearInputElement();
287
287
  }
288
288
  setPosition(left, top) {
@@ -530,11 +530,11 @@ export class IFrameInputEditor extends InputEditorBase {
530
530
  body.style.margin = "0px";
531
531
  body.style.overflow = "hidden";
532
532
  }
533
- initializeIfNotReadOnlyCore() {
533
+ initializeEditableStateCore() {
534
534
  if (Browser.WebKitFamily)
535
- this.editableDocument.body.setAttribute("contenteditable", "true");
535
+ this.editableDocument.body.setAttribute("contenteditable", String(!this.control.isReadOnlyPersistent));
536
536
  else
537
- this.editableDocument.designMode = "on";
537
+ this.editableDocument.designMode = this.control.isReadOnlyPersistent ? "off" : "on";
538
538
  }
539
539
  createInputElement() {
540
540
  const element = document.createElement("IFRAME");
@@ -673,7 +673,7 @@ export class IFrameInputEditor extends InputEditorBase {
673
673
  recreateIfNeeded() {
674
674
  const iframeDocument = this.inputElement.contentDocument || this.inputElement.contentWindow.document;
675
675
  if (!iframeDocument.body.hasAttribute("loaded")) {
676
- this.initializedIfNotReadOnly = false;
676
+ this.editableStateInitialized = false;
677
677
  this.createHierarchyCore();
678
678
  this.initialize();
679
679
  }
@@ -708,6 +708,7 @@ export class IFrameInputEditor extends InputEditorBase {
708
708
  }
709
709
  startInputIME() {
710
710
  this.inputElement.style.position = "absolute";
711
+ this.inputElement.style.zoom = this.control.viewManager.zoomLevel;
711
712
  const lastSelectedIntervalStartPosition = this.control.selection.lastSelectedInterval.start;
712
713
  const subDocument = this.control.selection.activeSubDocument;
713
714
  const layoutPosition = subDocument.isMain() ?
@@ -721,6 +722,9 @@ export class IFrameInputEditor extends InputEditorBase {
721
722
  const propChar = HtmlConverter.getSizeSignificantRules(this.control.inputPosition.getMergedCharacterPropertiesRaw()).join(";");
722
723
  this.editableDocument.body.style.cssText = "padding: 0px; margin: 0px; overflow: hidden; color: transparent; " + propChar;
723
724
  this.editableDocument.body.style.textIndent = currentTextIndent;
725
+ if (Browser.Firefox && Browser.Version <= 137) {
726
+ this.editableDocument.body.style.zoom = this.control.viewManager.zoomLevel;
727
+ }
724
728
  let layoutX = layoutPosition.getLayoutX(this.control.measurer, DocumentLayoutDetailsLevel.Row);
725
729
  const layoutPoint = new LayoutPoint(layoutPosition.pageIndex, layoutX, layoutPosition.getLayoutY(DocumentLayoutDetailsLevel.Row));
726
730
  const pageElement = this.control.viewManager.cache[layoutPoint.pageIndex].page;
@@ -2,6 +2,9 @@ import { DocumentModel } from '../model/document-model';
2
2
  import { PositionManager } from '../model/position/position-manager';
3
3
  import { LayoutAnchoredObjectBox } from './main-structures/layout-boxes/layout-anchored-object-box';
4
4
  import { LayoutPage } from './main-structures/layout-page';
5
+ import { CanvasSizeInfo } from '../canvas/canvas-size-info';
6
+ import { Grid } from '../layout-formatter/table/grid-engine/grid';
7
+ import { Table } from '../model/tables/main-structures/table';
5
8
  export declare class ModelPositionHolder {
6
9
  private pos;
7
10
  private posManager;
@@ -25,9 +28,11 @@ export declare class DocumentLayout {
25
28
  isFullyFormatted: boolean;
26
29
  anchorObjectsPositionInfo: AnchorObjectsPositionInfo;
27
30
  pageColor: number;
31
+ get grids(): Map<Table, Grid>;
28
32
  constructor(anchorObjectsPositionInfo: AnchorObjectsPositionInfo);
29
33
  setEmptyLayout(pageColor: number): void;
30
34
  getLastValidPage(): LayoutPage;
31
35
  isPageValid(pageIndex: number): boolean;
32
36
  getPageBySubDocumentId(subDocumentId: number): LayoutPage;
37
+ findPageIndexByOffsetY(offsetY: number, sizeInfo: CanvasSizeInfo): number;
33
38
  }
@@ -1,5 +1,7 @@
1
1
  import { NumberMapUtils } from '@devexpress/utils/lib/utils/map/number';
2
2
  import { ColorHelper } from '../model/color/color';
3
+ import { SearchUtils } from '@devexpress/utils/lib/utils/search';
4
+ import { MixedSize } from '../utils/mixed-size';
3
5
  export class ModelPositionHolder {
4
6
  constructor(pos, posManager) {
5
7
  this.pos = posManager.registerPosition(pos);
@@ -37,6 +39,12 @@ export class AnchorObjectsPositionInfo {
37
39
  }
38
40
  }
39
41
  export class DocumentLayout {
42
+ get grids() {
43
+ return this.pages.reduce((res, page) => {
44
+ page.grids.forEach((grid, table) => res.set(table, grid));
45
+ return res;
46
+ }, new Map());
47
+ }
40
48
  constructor(anchorObjectsPositionInfo) {
41
49
  this.anchorObjectsPositionInfo = anchorObjectsPositionInfo;
42
50
  this.setEmptyLayout(ColorHelper.NO_COLOR);
@@ -58,4 +66,9 @@ export class DocumentLayout {
58
66
  getPageBySubDocumentId(subDocumentId) {
59
67
  return this.pages.find((page) => !!page.mainSubDocumentPageAreas[subDocumentId] || !!page.otherPageAreas[subDocumentId]);
60
68
  }
69
+ findPageIndexByOffsetY(offsetY, sizeInfo) {
70
+ const getPageOffsetY = (p) => MixedSize.fromLayout(sizeInfo.getPageOffsetY(p)).useScale(sizeInfo.zoomLevel).UISize;
71
+ const normedInterpolationIndex = SearchUtils.normedInterpolationIndexOf(this.pages, getPageOffsetY, offsetY);
72
+ return Math.max(0, normedInterpolationIndex);
73
+ }
61
74
  }
@@ -1,10 +1,13 @@
1
1
  import { Rectangle } from '@devexpress/utils/lib/geometry/rectangle';
2
2
  import { SubDocument } from '../../model/sub-document';
3
3
  import { LayoutColumn } from './layout-column';
4
+ import { Grid } from '../../layout-formatter/table/grid-engine/grid';
5
+ import { Table } from '../../model/tables/main-structures/table';
4
6
  export declare class LayoutPageArea extends Rectangle {
5
7
  subDocument: SubDocument;
6
8
  columns: LayoutColumn[];
7
9
  pageOffset: number;
10
+ get grids(): Map<Table, Grid>;
8
11
  constructor(subDocument: SubDocument);
9
12
  getEndPosition(): number;
10
13
  getLastColumn(): LayoutColumn;
@@ -1,6 +1,12 @@
1
1
  import { Rectangle } from '@devexpress/utils/lib/geometry/rectangle';
2
2
  import { ListUtils } from '@devexpress/utils/lib/utils/list';
3
3
  export class LayoutPageArea extends Rectangle {
4
+ get grids() {
5
+ return this.columns.reduce((res, column) => {
6
+ column.tablesInfo.forEach(tableInfo => res.set(tableInfo.logicInfo.grid.table, tableInfo.logicInfo.grid));
7
+ return res;
8
+ }, new Map());
9
+ }
4
10
  constructor(subDocument) {
5
11
  super(0, 0, 0, 0);
6
12
  this.columns = [];
@@ -8,6 +8,8 @@ import { AnchorObjectsPositionInfo } from '../document-layout';
8
8
  import { LayoutAnchoredObjectBox } from './layout-boxes/layout-anchored-object-box';
9
9
  import { LayoutPageArea } from './layout-page-area';
10
10
  import { TableAnchoredObjectsHolder } from '../../layout-formatter/table/utils/table-anchored-objects-holder';
11
+ import { Grid } from '../../layout-formatter/table/grid-engine/grid';
12
+ import { Table } from '../../model/tables/main-structures/table';
11
13
  export declare enum LayoutPageFlags {
12
14
  MustBeRendered = 1,
13
15
  ContentRendered = 2,
@@ -42,6 +44,7 @@ export declare class LayoutPage extends Rectangle {
42
44
  tableAnchoredObjectsHolder: TableAnchoredObjectsHolder;
43
45
  renderLevelCalculator: RenderLevelCalculator;
44
46
  private contentIntervals;
47
+ get grids(): Map<Table, Grid>;
45
48
  constructor();
46
49
  setRenderLevelCalculator(anchorObjectsPositionInfo: AnchorObjectsPositionInfo, compatibilityMode: CompatibilityMode): void;
47
50
  setAbsolutePosition(pos: number): void;
@@ -38,6 +38,14 @@ export class LayoutOtherPageAreasInfo {
38
38
  }
39
39
  }
40
40
  export class LayoutPage extends Rectangle {
41
+ get grids() {
42
+ const result = new Map();
43
+ for (let pageArea of this.mainSubDocumentPageAreas)
44
+ pageArea.grids.forEach((grid, table) => result.set(table, grid));
45
+ for (let pageArea of Object.values(this.otherPageAreas))
46
+ pageArea.grids.forEach((grid, table) => result.set(table, grid));
47
+ return result;
48
+ }
41
49
  constructor() {
42
50
  super(0, 0, 0, 0);
43
51
  this.mainSubDocumentPageAreas = [];