devexpress-richedit 24.2.7-build-25100-0108 → 24.2.7

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 (33) hide show
  1. package/dist/dx.richedit.js +259 -210
  2. package/dist/dx.richedit.min.js +1 -1
  3. package/lib/client/client-rich-edit.js +2 -2
  4. package/lib/client/commands/mail-merge-command.js +2 -1
  5. package/lib/client/formats/docx/export/data.d.ts +5 -1
  6. package/lib/client/formats/docx/export/data.js +3 -2
  7. package/lib/client/formats/docx/export/exporter.d.ts +2 -3
  8. package/lib/client/formats/docx/export/exporter.js +3 -3
  9. package/lib/client/formats/docx/export/exporters/base/table/table.d.ts +1 -1
  10. package/lib/client/formats/docx/export/exporters/base/table/table.js +4 -4
  11. package/lib/client/formats/docx/import/destination/paragraph-properties/properties/paragraph-spacing-destination.js +6 -4
  12. package/lib/client/model-api/formats/exporter.js +1 -1
  13. package/lib/client/public/rich-edit.js +2 -2
  14. package/lib/common/canvas/renderes/common/document-renderer.js +10 -12
  15. package/lib/common/formats/i-document-exporter.d.ts +3 -0
  16. package/lib/common/input-controller.d.ts +5 -5
  17. package/lib/common/input-controller.js +12 -12
  18. package/lib/common/layout/document-layout.d.ts +3 -0
  19. package/lib/common/layout/document-layout.js +6 -0
  20. package/lib/common/layout/main-structures/layout-page-area.d.ts +3 -0
  21. package/lib/common/layout/main-structures/layout-page-area.js +6 -0
  22. package/lib/common/layout/main-structures/layout-page.d.ts +3 -0
  23. package/lib/common/layout/main-structures/layout-page.js +8 -0
  24. package/lib/common/layout-formatter/floating/position-calculators/horizontal.d.ts +1 -0
  25. package/lib/common/layout-formatter/floating/position-calculators/horizontal.js +16 -12
  26. package/lib/common/layout-formatter/row/states.js +0 -2
  27. package/lib/common/layout-formatter/row/tab-info.js +1 -1
  28. package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.d.ts +1 -1
  29. package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.js +22 -25
  30. package/lib/common/rich-edit-core.js +3 -2
  31. package/lib/common/utils/size-utils.d.ts +7 -0
  32. package/lib/common/utils/size-utils.js +31 -4
  33. package/package.json +3 -3
@@ -1,4 +1,10 @@
1
+ type ScrollbarsWidth = {
2
+ horizontal: number;
3
+ vertical: number;
4
+ };
1
5
  export declare class SizeUtils {
6
+ private static _scrollbarsWidth;
7
+ static getScrollbarsWidth(): ScrollbarsWidth;
2
8
  static getWidthInfo(element: HTMLElement): DimensionInfo;
3
9
  static getClientWidth(element: HTMLElement): number;
4
10
  static getHeightInfo(element: HTMLElement): DimensionInfo;
@@ -13,3 +19,4 @@ export declare class DimensionInfo {
13
19
  readonly scrollbarSize: number;
14
20
  constructor(offsetSize: number, clientSize: number, scrollbarSize: number);
15
21
  }
22
+ export {};
@@ -1,11 +1,36 @@
1
+ import { isDefined } from "@devexpress/utils/lib/utils/common";
1
2
  export class SizeUtils {
3
+ static getScrollbarsWidth() {
4
+ if (!isDefined(this._scrollbarsWidth)) {
5
+ const scrollDiv = document.createElement('div');
6
+ scrollDiv.style.visibility = 'hidden';
7
+ scrollDiv.style.overflow = 'scroll';
8
+ scrollDiv.style.position = 'absolute';
9
+ scrollDiv.style.top = '-9999px';
10
+ scrollDiv.style.width = '100px';
11
+ scrollDiv.style.height = '100px';
12
+ document.body.appendChild(scrollDiv);
13
+ const innerDiv = document.createElement('div');
14
+ innerDiv.style.width = '100%';
15
+ innerDiv.style.height = '100%';
16
+ scrollDiv.appendChild(innerDiv);
17
+ this._scrollbarsWidth = {
18
+ horizontal: SizeUtils.getOffsetHeight(scrollDiv) - SizeUtils.getOffsetHeight(innerDiv),
19
+ vertical: SizeUtils.getOffsetWidth(scrollDiv) - SizeUtils.getOffsetWidth(innerDiv)
20
+ };
21
+ scrollDiv.remove();
22
+ }
23
+ return this._scrollbarsWidth;
24
+ }
2
25
  static getWidthInfo(element) {
3
26
  const computedStyle = getComputedStyle(element);
4
27
  const offsetWidth = this.getOffsetWidth(element);
5
28
  const offsetWidthWithoutBorder = offsetWidth
6
29
  - parseCssValue(computedStyle.borderLeftWidth)
7
30
  - parseCssValue(computedStyle.borderRightWidth);
8
- const scrollbarWidth = offsetWidthWithoutBorder - element.clientWidth;
31
+ let scrollbarWidth = 0;
32
+ if (Math.round(offsetWidthWithoutBorder) > element.clientWidth)
33
+ scrollbarWidth = SizeUtils.getScrollbarsWidth().vertical;
9
34
  const clientWidth = offsetWidthWithoutBorder - scrollbarWidth;
10
35
  return new DimensionInfo(offsetWidth, clientWidth, scrollbarWidth);
11
36
  }
@@ -18,9 +43,11 @@ export class SizeUtils {
18
43
  const offsetHeightWithoutBorder = offsetHeight
19
44
  - parseCssValue(computedStyle.borderTopWidth)
20
45
  - parseCssValue(computedStyle.borderBottomWidth);
21
- const scrollbarHeight = offsetHeightWithoutBorder - element.clientHeight;
22
- const clientHeight = offsetHeightWithoutBorder - scrollbarHeight;
23
- return new DimensionInfo(offsetHeight, clientHeight, scrollbarHeight);
46
+ let scrollbarWidth = 0;
47
+ if (Math.round(offsetHeightWithoutBorder) > element.clientHeight)
48
+ scrollbarWidth = SizeUtils.getScrollbarsWidth().horizontal;
49
+ const clientHeight = offsetHeightWithoutBorder - scrollbarWidth;
50
+ return new DimensionInfo(offsetHeight, clientHeight, scrollbarWidth);
24
51
  }
25
52
  static getClientHeight(element) {
26
53
  return this.getHeightInfo(element).clientSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devexpress-richedit",
3
- "version": "24.2.7-build-25100-0108",
3
+ "version": "24.2.7",
4
4
  "homepage": "https://www.devexpress.com/",
5
5
  "bugs": "https://www.devexpress.com/support/",
6
6
  "author": "Developer Express Inc.",
@@ -14,8 +14,8 @@
14
14
  "build-nspell": "webpack --mode production --config=bin/nspell.webpack.config.js"
15
15
  },
16
16
  "peerDependencies": {
17
- "devextreme": "24.2.7-build-25098-1935",
18
- "devextreme-dist": "24.2.7-build-25098-1935"
17
+ "devextreme": "24.2.7",
18
+ "devextreme-dist": "24.2.7"
19
19
  },
20
20
  "dependencies": {
21
21
  "jszip": "~3.10.1",