@syncfusion/ej2-office-common 35.1.37 → 35.1.42

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 (226) hide show
  1. package/dist/ej2-office-common.umd.min.js +2 -2
  2. package/dist/ej2-office-common.umd.min.js.map +1 -1
  3. package/dist/es6/ej2-office-common.es2015.js +5421 -6017
  4. package/dist/es6/ej2-office-common.es2015.js.map +1 -1
  5. package/dist/es6/ej2-office-common.es5.js +6270 -7203
  6. package/dist/es6/ej2-office-common.es5.js.map +1 -1
  7. package/dist/global/ej2-office-common.min.js +2 -2
  8. package/dist/global/ej2-office-common.min.js.map +1 -1
  9. package/dist/global/index.d.ts +1 -1
  10. package/office-common.js +4 -0
  11. package/package.json +11 -7
  12. package/src/index.d.ts +3 -17
  13. package/src/index.js +3 -18
  14. package/src/office-common/features/index.d.ts +6 -0
  15. package/src/office-common/features/index.js +6 -0
  16. package/src/office-common/features/mathml/index.d.ts +25 -0
  17. package/src/office-common/features/mathml/index.js +22 -0
  18. package/src/office-common/features/mathml/latex/latex-generator.d.ts +8 -0
  19. package/src/office-common/features/mathml/latex/latex-generator.js +357 -0
  20. package/src/office-common/features/mathml/latex/latex-parser.d.ts +87 -0
  21. package/src/office-common/features/mathml/latex/latex-parser.js +1206 -0
  22. package/src/office-common/features/mathml/latex/latex-symbols.d.ts +13 -0
  23. package/src/office-common/features/mathml/latex/latex-symbols.js +681 -0
  24. package/src/office-common/features/mathml/math-settings.d.ts +54 -0
  25. package/src/office-common/features/mathml/math-settings.js +174 -0
  26. package/src/office-common/features/mathml/office-math/adapter.d.ts +59 -0
  27. package/src/office-common/features/mathml/office-math/adapter.js +6 -0
  28. package/src/office-common/features/mathml/office-math/basic.d.ts +91 -0
  29. package/src/office-common/features/mathml/office-math/basic.js +93 -0
  30. package/src/office-common/features/mathml/office-math/break.d.ts +30 -0
  31. package/src/office-common/features/mathml/office-math/break.js +75 -0
  32. package/src/office-common/features/mathml/office-math/collection.d.ts +104 -0
  33. package/src/office-common/features/mathml/office-math/collection.js +170 -0
  34. package/src/office-common/features/mathml/office-math/entity.d.ts +12 -0
  35. package/src/office-common/features/mathml/office-math/entity.js +3 -0
  36. package/src/office-common/features/mathml/office-math/enums.d.ts +97 -0
  37. package/src/office-common/features/mathml/office-math/enums.js +108 -0
  38. package/src/office-common/features/mathml/office-math/format.d.ts +28 -0
  39. package/src/office-common/features/mathml/office-math/format.js +90 -0
  40. package/src/office-common/features/mathml/office-math/function-base.d.ts +27 -0
  41. package/src/office-common/features/mathml/office-math/function-base.js +69 -0
  42. package/src/office-common/features/mathml/office-math/function-collection.d.ts +29 -0
  43. package/src/office-common/features/mathml/office-math/function-collection.js +76 -0
  44. package/src/office-common/features/mathml/office-math/functions-basic.d.ts +118 -0
  45. package/src/office-common/features/mathml/office-math/functions-basic.js +331 -0
  46. package/src/office-common/features/mathml/office-math/functions-multi.d.ts +156 -0
  47. package/src/office-common/features/mathml/office-math/functions-multi.js +407 -0
  48. package/src/office-common/features/mathml/office-math/index.d.ts +27 -0
  49. package/src/office-common/features/mathml/office-math/index.js +25 -0
  50. package/src/office-common/features/mathml/office-math/keys.d.ts +6 -0
  51. package/src/office-common/features/mathml/office-math/keys.js +20 -0
  52. package/src/office-common/features/mathml/office-math/math-clone.d.ts +20 -0
  53. package/src/office-common/features/mathml/office-math/math-clone.js +203 -0
  54. package/src/office-common/features/mathml/office-math/math-collection.d.ts +19 -0
  55. package/src/office-common/features/mathml/office-math/math-collection.js +41 -0
  56. package/src/office-common/features/mathml/office-math/math-equality.d.ts +21 -0
  57. package/src/office-common/features/mathml/office-math/math-equality.js +115 -0
  58. package/src/office-common/features/mathml/office-math/math-paragraph.d.ts +58 -0
  59. package/src/office-common/features/mathml/office-math/math-paragraph.js +126 -0
  60. package/src/office-common/features/mathml/office-math/math-traversal.d.ts +23 -0
  61. package/src/office-common/features/mathml/office-math/math-traversal.js +95 -0
  62. package/src/office-common/features/mathml/office-math/matrix-collections.d.ts +54 -0
  63. package/src/office-common/features/mathml/office-math/matrix-collections.js +113 -0
  64. package/src/office-common/features/mathml/office-math/matrix-column.d.ts +43 -0
  65. package/src/office-common/features/mathml/office-math/matrix-column.js +96 -0
  66. package/src/office-common/features/mathml/office-math/matrix-row.d.ts +38 -0
  67. package/src/office-common/features/mathml/office-math/matrix-row.js +71 -0
  68. package/src/office-common/features/mathml/office-math/matrix.d.ts +62 -0
  69. package/src/office-common/features/mathml/office-math/matrix.js +158 -0
  70. package/src/office-common/features/mathml/office-math/office-math.d.ts +55 -0
  71. package/src/office-common/features/mathml/office-math/office-math.js +116 -0
  72. package/src/office-common/features/mathml/office-math/owner-holder.d.ts +42 -0
  73. package/src/office-common/features/mathml/office-math/owner-holder.js +87 -0
  74. package/src/office-common/features/mathml/office-math/property-store.d.ts +66 -0
  75. package/src/office-common/features/mathml/office-math/property-store.js +99 -0
  76. package/src/office-common/features/mathml/office-math/run-element.d.ts +31 -0
  77. package/src/office-common/features/mathml/office-math/run-element.js +97 -0
  78. package/src/office-common/features/mathml/office-math/unknown-element.d.ts +37 -0
  79. package/src/office-common/features/mathml/office-math/unknown-element.js +62 -0
  80. package/src/office-common/features/mathml/office-math/xml-equal.d.ts +13 -0
  81. package/src/office-common/features/mathml/office-math/xml-equal.js +24 -0
  82. package/src/office-common/features/mathml/parse/office-math-parser.d.ts +24 -0
  83. package/src/office-common/features/mathml/parse/office-math-parser.js +396 -0
  84. package/src/office-common/features/mathml/parse/office-math-properties.d.ts +165 -0
  85. package/src/office-common/features/mathml/parse/office-math-properties.js +432 -0
  86. package/src/office-common/features/mathml/parse/parse-options.d.ts +22 -0
  87. package/src/office-common/features/mathml/parse/parse-options.js +3 -0
  88. package/src/office-common/features/mathml/serialize/office-math-properties-writer.d.ts +38 -0
  89. package/src/office-common/features/mathml/serialize/office-math-properties-writer.js +267 -0
  90. package/src/office-common/features/mathml/serialize/office-math-serializer.d.ts +23 -0
  91. package/src/office-common/features/mathml/serialize/office-math-serializer.js +306 -0
  92. package/src/office-common/features/mathml/serialize/omml-writer.d.ts +123 -0
  93. package/src/office-common/features/mathml/serialize/omml-writer.js +135 -0
  94. package/src/office-common/index.d.ts +10 -0
  95. package/src/office-common/index.js +10 -0
  96. package/.eslintrc.json +0 -263
  97. package/.prettierrc.json +0 -5
  98. package/api-extractor.json +0 -35
  99. package/core.js +0 -4
  100. package/encryption.js +0 -4
  101. package/features.js +0 -4
  102. package/global.json +0 -6
  103. package/nuget.config +0 -7
  104. package/src/all.d.ts +0 -41
  105. package/src/all.js +0 -38
  106. package/src/features/index.d.ts +0 -11
  107. package/src/features/index.js +0 -11
  108. package/src/features/mathml/index.d.ts +0 -30
  109. package/src/features/mathml/index.js +0 -22
  110. package/src/features/mathml/math-factory.d.ts +0 -26
  111. package/src/features/mathml/math-factory.js +0 -568
  112. package/src/features/mathml/model/controls.d.ts +0 -896
  113. package/src/features/mathml/model/controls.js +0 -1541
  114. package/src/features/mathml/model/math-element.d.ts +0 -173
  115. package/src/features/mathml/model/math-element.js +0 -315
  116. package/src/features/mathml/model/roots.d.ts +0 -82
  117. package/src/features/mathml/model/roots.js +0 -177
  118. package/src/features/mathml/parse/math-parser.d.ts +0 -43
  119. package/src/features/mathml/parse/math-parser.js +0 -636
  120. package/src/features/mathml/serialize/math-serializer.d.ts +0 -34
  121. package/src/features/mathml/serialize/math-serializer.js +0 -749
  122. package/tsconfig.build.json +0 -13
  123. package/tsconfig.harness.json +0 -32
  124. package/tslint.json +0 -111
  125. /package/src/{core → office-common/core}/index.d.ts +0 -0
  126. /package/src/{core → office-common/core}/index.js +0 -0
  127. /package/src/{core → office-common/core}/xml/index.d.ts +0 -0
  128. /package/src/{core → office-common/core}/xml/index.js +0 -0
  129. /package/src/{core → office-common/core}/xml/model.d.ts +0 -0
  130. /package/src/{core → office-common/core}/xml/model.js +0 -0
  131. /package/src/{encryption → office-common/encryption}/agile-constants.d.ts +0 -0
  132. /package/src/{encryption → office-common/encryption}/agile-constants.js +0 -0
  133. /package/src/{encryption → office-common/encryption}/agile-encryption-info.d.ts +0 -0
  134. /package/src/{encryption → office-common/encryption}/agile-encryption-info.js +0 -0
  135. /package/src/{encryption → office-common/encryption}/agile-password.d.ts +0 -0
  136. /package/src/{encryption → office-common/encryption}/agile-password.js +0 -0
  137. /package/src/{encryption → office-common/encryption}/cfb-reader.d.ts +0 -0
  138. /package/src/{encryption → office-common/encryption}/cfb-reader.js +0 -0
  139. /package/src/{encryption → office-common/encryption}/crypto-primitives.d.ts +0 -0
  140. /package/src/{encryption → office-common/encryption}/crypto-primitives.js +0 -0
  141. /package/src/{encryption → office-common/encryption}/decrypt-encrypted-package.d.ts +0 -0
  142. /package/src/{encryption → office-common/encryption}/decrypt-encrypted-package.js +0 -0
  143. /package/src/{encryption → office-common/encryption}/encryption-info-xml.d.ts +0 -0
  144. /package/src/{encryption → office-common/encryption}/encryption-info-xml.js +0 -0
  145. /package/src/{encryption → office-common/encryption}/errors.d.ts +0 -0
  146. /package/src/{encryption → office-common/encryption}/errors.js +0 -0
  147. /package/src/{encryption → office-common/encryption}/index.d.ts +0 -0
  148. /package/src/{encryption → office-common/encryption}/index.js +0 -0
  149. /package/src/{features → office-common/features}/diagrams/constants.d.ts +0 -0
  150. /package/src/{features → office-common/features}/diagrams/constants.js +0 -0
  151. /package/src/{features → office-common/features}/diagrams/diagram-data-model.d.ts +0 -0
  152. /package/src/{features → office-common/features}/diagrams/diagram-data-model.js +0 -0
  153. /package/src/{features → office-common/features}/diagrams/diagram-parsers.d.ts +0 -0
  154. /package/src/{features → office-common/features}/diagrams/diagram-parsers.js +0 -0
  155. /package/src/{features → office-common/features}/diagrams/diagram-serializers.d.ts +0 -0
  156. /package/src/{features → office-common/features}/diagrams/diagram-serializers.js +0 -0
  157. /package/src/{features → office-common/features}/diagrams/diagram-views.d.ts +0 -0
  158. /package/src/{features → office-common/features}/diagrams/diagram-views.js +0 -0
  159. /package/src/{features → office-common/features}/diagrams/element-tree.d.ts +0 -0
  160. /package/src/{features → office-common/features}/diagrams/element-tree.js +0 -0
  161. /package/src/{features → office-common/features}/diagrams/errors.d.ts +0 -0
  162. /package/src/{features → office-common/features}/diagrams/errors.js +0 -0
  163. /package/src/{features → office-common/features}/diagrams/index.d.ts +0 -0
  164. /package/src/{features → office-common/features}/diagrams/index.js +0 -0
  165. /package/src/{features → office-common/features}/diagrams/smart-art-catalog.d.ts +0 -0
  166. /package/src/{features → office-common/features}/diagrams/smart-art-catalog.js +0 -0
  167. /package/src/{features → office-common/features}/diagrams/smart-art-diagram.d.ts +0 -0
  168. /package/src/{features → office-common/features}/diagrams/smart-art-diagram.js +0 -0
  169. /package/src/{features → office-common/features}/ink/constants.d.ts +0 -0
  170. /package/src/{features → office-common/features}/ink/constants.js +0 -0
  171. /package/src/{features → office-common/features}/ink/index.d.ts +0 -0
  172. /package/src/{features → office-common/features}/ink/index.js +0 -0
  173. /package/src/{features → office-common/features}/ink/ink-effects.d.ts +0 -0
  174. /package/src/{features → office-common/features}/ink/ink-effects.js +0 -0
  175. /package/src/{features → office-common/features}/ink/ink-model.d.ts +0 -0
  176. /package/src/{features → office-common/features}/ink/ink-model.js +0 -0
  177. /package/src/{features → office-common/features}/ink/ink-parser.d.ts +0 -0
  178. /package/src/{features → office-common/features}/ink/ink-parser.js +0 -0
  179. /package/src/{features → office-common/features}/ink/ink-serializer.d.ts +0 -0
  180. /package/src/{features → office-common/features}/ink/ink-serializer.js +0 -0
  181. /package/src/{features → office-common/features}/ink/ink-units.d.ts +0 -0
  182. /package/src/{features → office-common/features}/ink/ink-units.js +0 -0
  183. /package/src/{features → office-common/features}/ink/ink-xml.d.ts +0 -0
  184. /package/src/{features → office-common/features}/ink/ink-xml.js +0 -0
  185. /package/src/{features → office-common/features}/ink/trace-codec.d.ts +0 -0
  186. /package/src/{features → office-common/features}/ink/trace-codec.js +0 -0
  187. /package/src/{features → office-common/features}/mathml/constants.d.ts +0 -0
  188. /package/src/{features → office-common/features}/mathml/constants.js +0 -0
  189. /package/src/{features → office-common/features}/mathml/errors.d.ts +0 -0
  190. /package/src/{features → office-common/features}/mathml/errors.js +0 -0
  191. /package/src/{features → office-common/features}/mathml/model/enums.d.ts +0 -0
  192. /package/src/{features → office-common/features}/mathml/model/enums.js +0 -0
  193. /package/src/{features → office-common/features}/mathml/openxml.d.ts +0 -0
  194. /package/src/{features → office-common/features}/mathml/openxml.js +0 -0
  195. /package/src/{features → office-common/features}/smart-art/diagram-xml.d.ts +0 -0
  196. /package/src/{features → office-common/features}/smart-art/diagram-xml.js +0 -0
  197. /package/src/{features → office-common/features}/smart-art/errors.d.ts +0 -0
  198. /package/src/{features → office-common/features}/smart-art/errors.js +0 -0
  199. /package/src/{features → office-common/features}/smart-art/index.d.ts +0 -0
  200. /package/src/{features → office-common/features}/smart-art/index.js +0 -0
  201. /package/src/{features → office-common/features}/smart-art/minimal-samples.d.ts +0 -0
  202. /package/src/{features → office-common/features}/smart-art/minimal-samples.js +0 -0
  203. /package/src/{features → office-common/features}/smart-art/mutators.d.ts +0 -0
  204. /package/src/{features → office-common/features}/smart-art/mutators.js +0 -0
  205. /package/src/{features → office-common/features}/smart-art/namespaces.d.ts +0 -0
  206. /package/src/{features → office-common/features}/smart-art/namespaces.js +0 -0
  207. /package/src/{features → office-common/features}/smart-art/package-graph.d.ts +0 -0
  208. /package/src/{features → office-common/features}/smart-art/package-graph.js +0 -0
  209. /package/src/{features → office-common/features}/smart-art/parse-colors.d.ts +0 -0
  210. /package/src/{features → office-common/features}/smart-art/parse-colors.js +0 -0
  211. /package/src/{features → office-common/features}/smart-art/parse-data.d.ts +0 -0
  212. /package/src/{features → office-common/features}/smart-art/parse-data.js +0 -0
  213. /package/src/{features → office-common/features}/smart-art/parse-layout.d.ts +0 -0
  214. /package/src/{features → office-common/features}/smart-art/parse-layout.js +0 -0
  215. /package/src/{features → office-common/features}/smart-art/parse-rel-ids.d.ts +0 -0
  216. /package/src/{features → office-common/features}/smart-art/parse-rel-ids.js +0 -0
  217. /package/src/{features → office-common/features}/smart-art/parse-style.d.ts +0 -0
  218. /package/src/{features → office-common/features}/smart-art/parse-style.js +0 -0
  219. /package/src/{features → office-common/features}/smart-art/point-text.d.ts +0 -0
  220. /package/src/{features → office-common/features}/smart-art/point-text.js +0 -0
  221. /package/src/{features → office-common/features}/smart-art/register.d.ts +0 -0
  222. /package/src/{features → office-common/features}/smart-art/register.js +0 -0
  223. /package/src/{features → office-common/features}/smart-art/serialize.d.ts +0 -0
  224. /package/src/{features → office-common/features}/smart-art/serialize.js +0 -0
  225. /package/src/{features → office-common/features}/smart-art/types.d.ts +0 -0
  226. /package/src/{features → office-common/features}/smart-art/types.js +0 -0
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Structural traversal shared by clone and equality over the Math model.
3
+ */
4
+ var __values = (this && this.__values) || function (o) {
5
+ var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
6
+ if (m) return m.call(o);
7
+ return {
8
+ next: function () {
9
+ if (o && i >= o.length) o = void 0;
10
+ return { value: o && o[i++], done: !o };
11
+ }
12
+ };
13
+ };
14
+ var __read = (this && this.__read) || function (o, n) {
15
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
16
+ if (!m) return o;
17
+ var i = m.call(o), r, ar = [], e;
18
+ try {
19
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
20
+ }
21
+ catch (error) { e = { error: error }; }
22
+ finally {
23
+ try {
24
+ if (r && !r.done && (m = i["return"])) m.call(i);
25
+ }
26
+ finally { if (e) throw e.error; }
27
+ }
28
+ return ar;
29
+ };
30
+ var __spread = (this && this.__spread) || function () {
31
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
32
+ return ar;
33
+ };
34
+ import { MathFunctionType } from './enums';
35
+ import { OfficeMath } from './office-math';
36
+ /**
37
+ * Lists the child equations of a function in a fixed, schema-like order.
38
+ * Matrix cells are listed row by row.
39
+ *
40
+ * @param {OfficeMathFunctionBase} fn The function to inspect.
41
+ * @returns {OfficeMath[]} Child equations in order.
42
+ * @private
43
+ */
44
+ export function childEquations(fn) {
45
+ var holder = fn;
46
+ if (fn.type === MathFunctionType.Matrix) {
47
+ var cells_1 = [];
48
+ fn.rowItems.forEach(function (row) {
49
+ var e_1, _a;
50
+ try {
51
+ for (var _b = __values(row.arguments), _c = _b.next(); !_c.done; _c = _b.next()) {
52
+ var cell = _c.value;
53
+ cells_1.push(cell);
54
+ }
55
+ }
56
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
57
+ finally {
58
+ try {
59
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
60
+ }
61
+ finally { if (e_1) throw e_1.error; }
62
+ }
63
+ });
64
+ return cells_1;
65
+ }
66
+ var result = [];
67
+ ['equation', 'degree', 'numerator', 'denominator', 'functionName', 'limit', 'script', 'subscript', 'superscript']
68
+ .forEach(function (name) {
69
+ var value = holder[name];
70
+ if (value instanceof OfficeMath) {
71
+ result.push(value);
72
+ }
73
+ });
74
+ var list = holder['equations'];
75
+ if (list !== undefined) {
76
+ result.push.apply(result, __spread(Array.from(list)));
77
+ }
78
+ return result;
79
+ }
80
+ /**
81
+ * Returns the manual break owned by a box or run element.
82
+ *
83
+ * @param {OfficeMathFunctionBase} fn The function to inspect.
84
+ * @returns {OfficeMathBreak | undefined} The break, when present.
85
+ * @private
86
+ */
87
+ export function breakOf(fn) {
88
+ if (fn.type === MathFunctionType.Box) {
89
+ return fn.break;
90
+ }
91
+ if (fn.type === MathFunctionType.RunElement) {
92
+ return fn.mathFormat.break;
93
+ }
94
+ return undefined;
95
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Matrix row and column collections that keep rows and columns synchronized.
3
+ */
4
+ import { OwnedCollection } from './collection';
5
+ import { OfficeMathMatrixRow } from './matrix-row';
6
+ import { OfficeMathMatrixColumn } from './matrix-column';
7
+ import { OfficeMathMatrix } from './matrix';
8
+ /**
9
+ * Rows of a matrix. New rows receive one cell per existing column.
10
+ *
11
+ * @public
12
+ */
13
+ export declare class OfficeMathMatrixRowCollection extends OwnedCollection<OfficeMathMatrixRow> {
14
+ private readonly matrix;
15
+ constructor(matrix: OfficeMathMatrix);
16
+ /**
17
+ * Creates a row and appends it, or inserts it at `index`.
18
+ *
19
+ * @param index
20
+ */
21
+ add(index?: number): OfficeMathMatrixRow;
22
+ protected afterChange(): void;
23
+ }
24
+ /**
25
+ * Columns of a matrix. Adding or removing a column adds or removes the cell in every row.
26
+ *
27
+ * @public
28
+ */
29
+ export declare class OfficeMathMatrixColumnCollection extends OwnedCollection<OfficeMathMatrixColumn> {
30
+ private readonly matrix;
31
+ constructor(matrix: OfficeMathMatrix);
32
+ /**
33
+ * Creates a column and appends it, or inserts it at `index`.
34
+ *
35
+ * @param index
36
+ */
37
+ add(index?: number): OfficeMathMatrixColumn;
38
+ /**
39
+ * Removes the column and its cell in every row.
40
+ *
41
+ * @param index
42
+ */
43
+ removeAt(index: number): void;
44
+ /** Removes all columns and every cell. */
45
+ clear(): void;
46
+ protected afterChange(): void;
47
+ /**
48
+ * Adds the matching cell to every row once the column is inserted.
49
+ *
50
+ * @param index
51
+ * @param item
52
+ */
53
+ insertItem(index: number, item: OfficeMathMatrixColumn): void;
54
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Matrix row and column collections that keep rows and columns synchronized.
3
+ */
4
+ var __extends = (this && this.__extends) || (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics = Object.setPrototypeOf ||
7
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
9
+ return extendStatics(d, b);
10
+ };
11
+ return function (d, b) {
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ import { OwnedCollection } from './collection';
18
+ import { OfficeMath } from './office-math';
19
+ import { OfficeMathMatrixRow } from './matrix-row';
20
+ import { OfficeMathMatrixColumn } from './matrix-column';
21
+ /**
22
+ * Rows of a matrix. New rows receive one cell per existing column.
23
+ *
24
+ * @public
25
+ */
26
+ var OfficeMathMatrixRowCollection = /** @class */ (function (_super) {
27
+ __extends(OfficeMathMatrixRowCollection, _super);
28
+ function OfficeMathMatrixRowCollection(matrix) {
29
+ var _this = _super.call(this, matrix) || this;
30
+ _this.matrix = matrix;
31
+ return _this;
32
+ }
33
+ /**
34
+ * Creates a row and appends it, or inserts it at `index`.
35
+ *
36
+ * @param index
37
+ */
38
+ OfficeMathMatrixRowCollection.prototype.add = function (index) {
39
+ var row = new OfficeMathMatrixRow();
40
+ var columnCount = this.matrix.columns.count;
41
+ for (var i = 0; i < columnCount; i++) {
42
+ row.arguments.pushRaw(new OfficeMath(row));
43
+ }
44
+ this.insertItem(index === undefined ? this.count : index, row);
45
+ return row;
46
+ };
47
+ OfficeMathMatrixRowCollection.prototype.afterChange = function () {
48
+ this.matrix.relink();
49
+ _super.prototype.afterChange.call(this);
50
+ };
51
+ return OfficeMathMatrixRowCollection;
52
+ }(OwnedCollection));
53
+ export { OfficeMathMatrixRowCollection };
54
+ /**
55
+ * Columns of a matrix. Adding or removing a column adds or removes the cell in every row.
56
+ *
57
+ * @public
58
+ */
59
+ var OfficeMathMatrixColumnCollection = /** @class */ (function (_super) {
60
+ __extends(OfficeMathMatrixColumnCollection, _super);
61
+ function OfficeMathMatrixColumnCollection(matrix) {
62
+ var _this = _super.call(this, matrix) || this;
63
+ _this.matrix = matrix;
64
+ return _this;
65
+ }
66
+ /**
67
+ * Creates a column and appends it, or inserts it at `index`.
68
+ *
69
+ * @param index
70
+ */
71
+ OfficeMathMatrixColumnCollection.prototype.add = function (index) {
72
+ var position = index === undefined ? this.count : index;
73
+ var column = new OfficeMathMatrixColumn();
74
+ this.insertItem(position, column);
75
+ return column;
76
+ };
77
+ /**
78
+ * Removes the column and its cell in every row.
79
+ *
80
+ * @param index
81
+ */
82
+ OfficeMathMatrixColumnCollection.prototype.removeAt = function (index) {
83
+ _super.prototype.removeAt.call(this, index);
84
+ this.matrix.rowItems.forEach(function (row) { return row.arguments.removeRawAt(index); });
85
+ this.matrix.relink();
86
+ };
87
+ /** Removes all columns and every cell. */
88
+ OfficeMathMatrixColumnCollection.prototype.clear = function () {
89
+ _super.prototype.clear.call(this);
90
+ this.matrix.rowItems.forEach(function (row) {
91
+ while (row.arguments.count > 0) {
92
+ row.arguments.removeRawAt(row.arguments.count - 1);
93
+ }
94
+ });
95
+ };
96
+ OfficeMathMatrixColumnCollection.prototype.afterChange = function () {
97
+ this.matrix.relink();
98
+ _super.prototype.afterChange.call(this);
99
+ };
100
+ /**
101
+ * Adds the matching cell to every row once the column is inserted.
102
+ *
103
+ * @param index
104
+ * @param item
105
+ */
106
+ OfficeMathMatrixColumnCollection.prototype.insertItem = function (index, item) {
107
+ _super.prototype.insertItem.call(this, index, item);
108
+ this.matrix.rowItems.forEach(function (row) { return row.arguments.insertRaw(index, new OfficeMath(row)); });
109
+ this.matrix.relink();
110
+ };
111
+ return OfficeMathMatrixColumnCollection;
112
+ }(OwnedCollection));
113
+ export { OfficeMathMatrixColumnCollection };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Matrix column.
3
+ */
4
+ import { OwnerHolder } from './owner-holder';
5
+ import { MathHorizontalAlignment } from './enums';
6
+ import { OfficeMath } from './office-math';
7
+ import { OfficeMathMatrix } from './matrix';
8
+ /**
9
+ * Read-only view of the cells of one column.
10
+ *
11
+ * @public
12
+ */
13
+ export declare class OfficeMathMatrixColumnArguments {
14
+ [index: number]: OfficeMath;
15
+ private readonly _items;
16
+ constructor(items: OfficeMath[]);
17
+ /** Number of cells. */
18
+ readonly count: number;
19
+ /**
20
+ * Returns the cell at `index`.
21
+ *
22
+ * @param index
23
+ */
24
+ getItem(index: number): OfficeMath;
25
+ /** Not supported: cells are created when rows are added. */
26
+ add(): never;
27
+ /** Iterates the cells top to bottom. */
28
+ [Symbol.iterator](): Iterator<OfficeMath>;
29
+ }
30
+ /**
31
+ * Column of a matrix.
32
+ *
33
+ * @public
34
+ */
35
+ export declare class OfficeMathMatrixColumn extends OwnerHolder {
36
+ constructor(owner?: OfficeMathMatrix);
37
+ /** Horizontal alignment of the column. Default center. */
38
+ horizontalAlignment: MathHorizontalAlignment;
39
+ /** Index of the column in its matrix, or -1 when detached. */
40
+ readonly columnIndex: number;
41
+ /** Cells of this column, one per row. */
42
+ readonly arguments: OfficeMathMatrixColumnArguments;
43
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Matrix column.
3
+ */
4
+ var __extends = (this && this.__extends) || (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics = Object.setPrototypeOf ||
7
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
9
+ return extendStatics(d, b);
10
+ };
11
+ return function (d, b) {
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ import { OwnerHolder } from './owner-holder';
18
+ import { MathHorizontalAlignment } from './enums';
19
+ import { K } from './keys';
20
+ /**
21
+ * Read-only view of the cells of one column.
22
+ *
23
+ * @public
24
+ */
25
+ var OfficeMathMatrixColumnArguments = /** @class */ (function () {
26
+ function OfficeMathMatrixColumnArguments(items) {
27
+ var _this = this;
28
+ this._items = items;
29
+ items.forEach(function (item, i) { _this[i] = item; });
30
+ }
31
+ Object.defineProperty(OfficeMathMatrixColumnArguments.prototype, "count", {
32
+ /** Number of cells. */
33
+ get: function () { return this._items.length; },
34
+ enumerable: true,
35
+ configurable: true
36
+ });
37
+ /**
38
+ * Returns the cell at `index`.
39
+ *
40
+ * @param index
41
+ */
42
+ OfficeMathMatrixColumnArguments.prototype.getItem = function (index) {
43
+ if (!(index >= 0 && index < this._items.length)) {
44
+ throw new RangeError('Index ' + index + ' is out of range.');
45
+ }
46
+ return this._items[index];
47
+ };
48
+ /** Not supported: cells are created when rows are added. */
49
+ OfficeMathMatrixColumnArguments.prototype.add = function () { throw new Error('Cells are managed by the matrix; add a row instead.'); };
50
+ /** Iterates the cells top to bottom. */
51
+ OfficeMathMatrixColumnArguments.prototype[Symbol.iterator] = function () { return this._items[Symbol.iterator](); };
52
+ return OfficeMathMatrixColumnArguments;
53
+ }());
54
+ export { OfficeMathMatrixColumnArguments };
55
+ /**
56
+ * Column of a matrix.
57
+ *
58
+ * @public
59
+ */
60
+ var OfficeMathMatrixColumn = /** @class */ (function (_super) {
61
+ __extends(OfficeMathMatrixColumn, _super);
62
+ function OfficeMathMatrixColumn(owner) {
63
+ return _super.call(this, owner) || this;
64
+ }
65
+ Object.defineProperty(OfficeMathMatrixColumn.prototype, "horizontalAlignment", {
66
+ /** Horizontal alignment of the column. Default center. */
67
+ get: function () {
68
+ return this.getProperty(K.MatrixAlign, function () { return MathHorizontalAlignment.Center; });
69
+ },
70
+ set: function (value) { this.setProperty(K.MatrixAlign, value); },
71
+ enumerable: true,
72
+ configurable: true
73
+ });
74
+ Object.defineProperty(OfficeMathMatrixColumn.prototype, "columnIndex", {
75
+ /** Index of the column in its matrix, or -1 when detached. */
76
+ get: function () {
77
+ var matrix = this.ownerMathEntity;
78
+ return matrix === undefined ? -1 : matrix.columns.toArray().indexOf(this);
79
+ },
80
+ enumerable: true,
81
+ configurable: true
82
+ });
83
+ Object.defineProperty(OfficeMathMatrixColumn.prototype, "arguments", {
84
+ /** Cells of this column, one per row. */
85
+ get: function () {
86
+ var matrix = this.ownerMathEntity;
87
+ var index = this.columnIndex;
88
+ var cells = matrix === undefined ? [] : matrix.rowItems.map(function (row) { return row.arguments.getItem(index); });
89
+ return new OfficeMathMatrixColumnArguments(cells);
90
+ },
91
+ enumerable: true,
92
+ configurable: true
93
+ });
94
+ return OfficeMathMatrixColumn;
95
+ }(OwnerHolder));
96
+ export { OfficeMathMatrixColumn };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Matrix row.
3
+ */
4
+ import { OwnerHolder } from './owner-holder';
5
+ import { OwnedCollection, CollectionOwner } from './collection';
6
+ import { OfficeMath } from './office-math';
7
+ import { OfficeMathMatrix } from './matrix';
8
+ /**
9
+ * Cells of a row. Managed by matrix synchronization, so direct mutation is rejected.
10
+ *
11
+ * @public
12
+ */
13
+ export declare class OfficeMathMatrixRowArguments extends OwnedCollection<OfficeMath> {
14
+ constructor(owner: CollectionOwner);
15
+ /** Not supported: cells are created when columns are added. */
16
+ add(): never;
17
+ /** Not supported: cells are managed by the matrix. */
18
+ insert(): never;
19
+ /** Not supported: cells are managed by the matrix. */
20
+ removeAt(): never;
21
+ /** Not supported: cells are managed by the matrix. */
22
+ remove(): never;
23
+ /** Not supported: cells are managed by the matrix. */
24
+ clear(): never;
25
+ }
26
+ /**
27
+ * Row of a matrix holding one cell per column.
28
+ *
29
+ * @public
30
+ */
31
+ export declare class OfficeMathMatrixRow extends OwnerHolder {
32
+ private readonly _arguments;
33
+ constructor(owner?: OfficeMathMatrix);
34
+ /** Cells of the row. */
35
+ readonly arguments: OfficeMathMatrixRowArguments;
36
+ /** Index of the row in its matrix, or -1 when detached. */
37
+ readonly rowIndex: number;
38
+ }
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Matrix row.
3
+ */
4
+ var __extends = (this && this.__extends) || (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics = Object.setPrototypeOf ||
7
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
9
+ return extendStatics(d, b);
10
+ };
11
+ return function (d, b) {
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ import { OwnerHolder } from './owner-holder';
18
+ import { OwnedCollection } from './collection';
19
+ /**
20
+ * Cells of a row. Managed by matrix synchronization, so direct mutation is rejected.
21
+ *
22
+ * @public
23
+ */
24
+ var OfficeMathMatrixRowArguments = /** @class */ (function (_super) {
25
+ __extends(OfficeMathMatrixRowArguments, _super);
26
+ function OfficeMathMatrixRowArguments(owner) {
27
+ return _super.call(this, owner) || this;
28
+ }
29
+ /** Not supported: cells are created when columns are added. */
30
+ OfficeMathMatrixRowArguments.prototype.add = function () { throw new Error('Cells are managed by the matrix; add a column instead.'); };
31
+ /** Not supported: cells are managed by the matrix. */
32
+ OfficeMathMatrixRowArguments.prototype.insert = function () { throw new Error('Cells are managed by the matrix.'); };
33
+ /** Not supported: cells are managed by the matrix. */
34
+ OfficeMathMatrixRowArguments.prototype.removeAt = function () { throw new Error('Cells are managed by the matrix; remove a column instead.'); };
35
+ /** Not supported: cells are managed by the matrix. */
36
+ OfficeMathMatrixRowArguments.prototype.remove = function () { throw new Error('Cells are managed by the matrix; remove a column instead.'); };
37
+ /** Not supported: cells are managed by the matrix. */
38
+ OfficeMathMatrixRowArguments.prototype.clear = function () { throw new Error('Cells are managed by the matrix; remove columns instead.'); };
39
+ return OfficeMathMatrixRowArguments;
40
+ }(OwnedCollection));
41
+ export { OfficeMathMatrixRowArguments };
42
+ /**
43
+ * Row of a matrix holding one cell per column.
44
+ *
45
+ * @public
46
+ */
47
+ var OfficeMathMatrixRow = /** @class */ (function (_super) {
48
+ __extends(OfficeMathMatrixRow, _super);
49
+ function OfficeMathMatrixRow(owner) {
50
+ var _this = _super.call(this, owner) || this;
51
+ _this._arguments = new OfficeMathMatrixRowArguments(_this);
52
+ return _this;
53
+ }
54
+ Object.defineProperty(OfficeMathMatrixRow.prototype, "arguments", {
55
+ /** Cells of the row. */
56
+ get: function () { return this._arguments; },
57
+ enumerable: true,
58
+ configurable: true
59
+ });
60
+ Object.defineProperty(OfficeMathMatrixRow.prototype, "rowIndex", {
61
+ /** Index of the row in its matrix, or -1 when detached. */
62
+ get: function () {
63
+ var matrix = this.ownerMathEntity;
64
+ return matrix === undefined ? -1 : matrix.rowItems.indexOf(this);
65
+ },
66
+ enumerable: true,
67
+ configurable: true
68
+ });
69
+ return OfficeMathMatrixRow;
70
+ }(OwnerHolder));
71
+ export { OfficeMathMatrixRow };
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Matrix (`m:m`) function.
3
+ */
4
+ import { MathFunctionType, MathVerticalAlignment, MathHorizontalAlignment, SpacingRule } from './enums';
5
+ import { OfficeMathFunctionBase } from './function-base';
6
+ import { OfficeMathEntity } from './entity';
7
+ import { OfficeMathMatrixRow } from './matrix-row';
8
+ import { OfficeMathMatrixRowCollection, OfficeMathMatrixColumnCollection } from './matrix-collections';
9
+ /** A run of consecutive columns that share the same horizontal alignment (`m:mcs`). @public */
10
+ export interface MatrixColumnGroup {
11
+ /** Index of the first column in the group. */
12
+ startIndex: number;
13
+ /** Number of columns in the group. */
14
+ count: number;
15
+ /** Shared horizontal alignment. */
16
+ horizontalAlignment: MathHorizontalAlignment;
17
+ }
18
+ /**
19
+ * Matrix whose rows and columns are kept synchronized: every row always has one cell per column.
20
+ *
21
+ * @public
22
+ */
23
+ export declare class OfficeMathMatrix extends OfficeMathFunctionBase {
24
+ readonly type = MathFunctionType.Matrix;
25
+ private readonly _rows;
26
+ private readonly _columns;
27
+ constructor(owner?: OfficeMathEntity);
28
+ /** Rows of the matrix. */
29
+ readonly rows: OfficeMathMatrixRowCollection;
30
+ /** Columns of the matrix. */
31
+ readonly columns: OfficeMathMatrixColumnCollection;
32
+ /** Vertical alignment. Default center. */
33
+ verticalAlignment: MathVerticalAlignment;
34
+ /** Hides placeholders for empty cells. Default false. */
35
+ hidePlaceholder: boolean;
36
+ /** Row spacing; unit depends on `rowSpacingRule`. Default 0. */
37
+ rowSpacing: number;
38
+ /** Row spacing rule (`m:rSpRule`). Default single. */
39
+ rowSpacingRule: SpacingRule;
40
+ /** Column gap (`m:cGp`). Default 0. */
41
+ columnGap: number;
42
+ /** Column gap rule (`m:cGpRule`). Default single. */
43
+ columnGapRule: SpacingRule;
44
+ /** DocIO-compatible alias of `hidePlaceholder` (`m:plcHide`). */
45
+ hidePlaceHolders: boolean;
46
+ /** DocIO-compatible alias of `columnGapRule` (`m:cGpRule`). */
47
+ columnSpacingRule: SpacingRule;
48
+ /** DocIO-compatible name for the column width (`m:cSp`); shares storage with `columnSpacing`. */
49
+ columnWidth: number;
50
+ /** Column spacing (`m:cSp`). Default 0. */
51
+ columnSpacing: number;
52
+ /** Column groups: consecutive columns with identical alignment, in order. */
53
+ readonly columnGroups: MatrixColumnGroup[];
54
+ /**
55
+ * Re-links every cell to its row and column after a structural change.
56
+ *
57
+ * @private
58
+ */
59
+ relink(): void;
60
+ /** @private */
61
+ readonly rowItems: OfficeMathMatrixRow[];
62
+ }