@hailin-zheng/editor-core 1.0.1 → 1.0.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 (216) hide show
  1. package/lib/doc-ruler.d.ts +51 -0
  2. package/lib/doc-ruler.js +313 -0
  3. package/lib/doc-ruler.js.map +1 -0
  4. package/lib/framework/common-util.d.ts +63 -0
  5. package/lib/framework/common-util.js +178 -0
  6. package/lib/framework/common-util.js.map +1 -0
  7. package/lib/framework/document-change.d.ts +265 -0
  8. package/lib/framework/document-change.js +1342 -0
  9. package/lib/framework/document-change.js.map +1 -0
  10. package/lib/framework/document-combine.d.ts +24 -0
  11. package/lib/framework/document-combine.js +40 -0
  12. package/lib/framework/document-combine.js.map +1 -0
  13. package/lib/framework/document-comment.d.ts +46 -0
  14. package/lib/framework/document-comment.js +148 -0
  15. package/lib/framework/document-comment.js.map +1 -0
  16. package/lib/framework/document-context.d.ts +149 -0
  17. package/lib/framework/document-context.js +330 -0
  18. package/lib/framework/document-context.js.map +1 -0
  19. package/lib/framework/document-eval-func.d.ts +18 -0
  20. package/lib/framework/document-eval-func.js +48 -0
  21. package/lib/framework/document-eval-func.js.map +1 -0
  22. package/lib/framework/document-event.d.ts +213 -0
  23. package/lib/framework/document-event.js +1054 -0
  24. package/lib/framework/document-event.js.map +1 -0
  25. package/lib/framework/document-history.d.ts +26 -0
  26. package/lib/framework/document-history.js +65 -0
  27. package/lib/framework/document-history.js.map +1 -0
  28. package/lib/framework/document-images-loader.d.ts +16 -0
  29. package/lib/framework/document-images-loader.js +66 -0
  30. package/lib/framework/document-images-loader.js.map +1 -0
  31. package/lib/framework/document-input-cursor.d.ts +78 -0
  32. package/lib/framework/document-input-cursor.js +239 -0
  33. package/lib/framework/document-input-cursor.js.map +1 -0
  34. package/lib/framework/document-paint.d.ts +34 -0
  35. package/lib/framework/document-paint.js +103 -0
  36. package/lib/framework/document-paint.js.map +1 -0
  37. package/lib/framework/document-print-offscreen.d.ts +38 -0
  38. package/lib/framework/document-print-offscreen.js +128 -0
  39. package/lib/framework/document-print-offscreen.js.map +1 -0
  40. package/lib/framework/document-print.d.ts +60 -0
  41. package/lib/framework/document-print.js +203 -0
  42. package/lib/framework/document-print.js.map +1 -0
  43. package/lib/framework/document-segmenter.d.ts +2 -0
  44. package/lib/framework/document-segmenter.js +106 -0
  45. package/lib/framework/document-segmenter.js.map +1 -0
  46. package/lib/framework/document-selection.d.ts +89 -0
  47. package/lib/framework/document-selection.js +358 -0
  48. package/lib/framework/document-selection.js.map +1 -0
  49. package/lib/framework/document-template.d.ts +4 -0
  50. package/lib/framework/document-template.js +20 -0
  51. package/lib/framework/document-template.js.map +1 -0
  52. package/lib/framework/document-textline-mode.d.ts +7 -0
  53. package/lib/framework/document-textline-mode.js +30 -0
  54. package/lib/framework/document-textline-mode.js.map +1 -0
  55. package/lib/framework/element-define.d.ts +319 -0
  56. package/lib/framework/element-define.js +579 -0
  57. package/lib/framework/element-define.js.map +1 -0
  58. package/lib/framework/element-event-define.d.ts +99 -0
  59. package/lib/framework/element-event-define.js +108 -0
  60. package/lib/framework/element-event-define.js.map +1 -0
  61. package/lib/framework/element-measure.d.ts +97 -0
  62. package/lib/framework/element-measure.js +551 -0
  63. package/lib/framework/element-measure.js.map +1 -0
  64. package/lib/framework/element-paint.d.ts +42 -0
  65. package/lib/framework/element-paint.js +170 -0
  66. package/lib/framework/element-paint.js.map +1 -0
  67. package/lib/framework/element-props.d.ts +301 -0
  68. package/lib/framework/element-props.js +809 -0
  69. package/lib/framework/element-props.js.map +1 -0
  70. package/lib/framework/element-reader.d.ts +19 -0
  71. package/lib/framework/element-reader.js +151 -0
  72. package/lib/framework/element-reader.js.map +1 -0
  73. package/lib/framework/element-render-cut.d.ts +55 -0
  74. package/lib/framework/element-render-cut.js +449 -0
  75. package/lib/framework/element-render-cut.js.map +1 -0
  76. package/lib/framework/element-serialize.d.ts +30 -0
  77. package/lib/framework/element-serialize.js +113 -0
  78. package/lib/framework/element-serialize.js.map +1 -0
  79. package/lib/framework/element-util.d.ts +369 -0
  80. package/lib/framework/element-util.js +1463 -0
  81. package/lib/framework/element-util.js.map +1 -0
  82. package/lib/framework/impl/checkbox/checkbox-impl.d.ts +24 -0
  83. package/lib/framework/impl/checkbox/checkbox-impl.js +64 -0
  84. package/lib/framework/impl/checkbox/checkbox-impl.js.map +1 -0
  85. package/lib/framework/impl/comments/comment-content-impl.d.ts +40 -0
  86. package/lib/framework/impl/comments/comment-content-impl.js +105 -0
  87. package/lib/framework/impl/comments/comment-content-impl.js.map +1 -0
  88. package/lib/framework/impl/comments/comment-element-impl.d.ts +21 -0
  89. package/lib/framework/impl/comments/comment-element-impl.js +62 -0
  90. package/lib/framework/impl/comments/comment-element-impl.js.map +1 -0
  91. package/lib/framework/impl/comments/comments-container-impl.d.ts +22 -0
  92. package/lib/framework/impl/comments/comments-container-impl.js +62 -0
  93. package/lib/framework/impl/comments/comments-container-impl.js.map +1 -0
  94. package/lib/framework/impl/comments/comments-util.d.ts +12 -0
  95. package/lib/framework/impl/comments/comments-util.js +67 -0
  96. package/lib/framework/impl/comments/comments-util.js.map +1 -0
  97. package/lib/framework/impl/comments/validate-msg-impl.d.ts +21 -0
  98. package/lib/framework/impl/comments/validate-msg-impl.js +83 -0
  99. package/lib/framework/impl/comments/validate-msg-impl.js.map +1 -0
  100. package/lib/framework/impl/data-element/data-decorate-impl.d.ts +30 -0
  101. package/lib/framework/impl/data-element/data-decorate-impl.js +91 -0
  102. package/lib/framework/impl/data-element/data-decorate-impl.js.map +1 -0
  103. package/lib/framework/impl/data-element/data-element-barcode.d.ts +31 -0
  104. package/lib/framework/impl/data-element/data-element-barcode.js +115 -0
  105. package/lib/framework/impl/data-element/data-element-barcode.js.map +1 -0
  106. package/lib/framework/impl/data-element/data-element-base-impl.d.ts +68 -0
  107. package/lib/framework/impl/data-element/data-element-base-impl.js +205 -0
  108. package/lib/framework/impl/data-element/data-element-base-impl.js.map +1 -0
  109. package/lib/framework/impl/data-element/data-element-check-impl.d.ts +35 -0
  110. package/lib/framework/impl/data-element/data-element-check-impl.js +133 -0
  111. package/lib/framework/impl/data-element/data-element-check-impl.js.map +1 -0
  112. package/lib/framework/impl/data-element/data-element-date-impl.d.ts +23 -0
  113. package/lib/framework/impl/data-element/data-element-date-impl.js +111 -0
  114. package/lib/framework/impl/data-element/data-element-date-impl.js.map +1 -0
  115. package/lib/framework/impl/data-element/data-element-group-impl.d.ts +23 -0
  116. package/lib/framework/impl/data-element/data-element-group-impl.js +130 -0
  117. package/lib/framework/impl/data-element/data-element-group-impl.js.map +1 -0
  118. package/lib/framework/impl/data-element/data-element-image-impl.d.ts +30 -0
  119. package/lib/framework/impl/data-element/data-element-image-impl.js +137 -0
  120. package/lib/framework/impl/data-element/data-element-image-impl.js.map +1 -0
  121. package/lib/framework/impl/data-element/data-element-list-impl.d.ts +22 -0
  122. package/lib/framework/impl/data-element/data-element-list-impl.js +131 -0
  123. package/lib/framework/impl/data-element/data-element-list-impl.js.map +1 -0
  124. package/lib/framework/impl/data-element/data-element-text-impl.d.ts +23 -0
  125. package/lib/framework/impl/data-element/data-element-text-impl.js +103 -0
  126. package/lib/framework/impl/data-element/data-element-text-impl.js.map +1 -0
  127. package/lib/framework/impl/decorate/fill-null-space-imple.d.ts +21 -0
  128. package/lib/framework/impl/decorate/fill-null-space-imple.js +43 -0
  129. package/lib/framework/impl/decorate/fill-null-space-imple.js.map +1 -0
  130. package/lib/framework/impl/document/doc-body-impl.d.ts +27 -0
  131. package/lib/framework/impl/document/doc-body-impl.js +79 -0
  132. package/lib/framework/impl/document/doc-body-impl.js.map +1 -0
  133. package/lib/framework/impl/document/doc-body-part-impl.d.ts +30 -0
  134. package/lib/framework/impl/document/doc-body-part-impl.js +94 -0
  135. package/lib/framework/impl/document/doc-body-part-impl.js.map +1 -0
  136. package/lib/framework/impl/document/doc-container-impl.d.ts +16 -0
  137. package/lib/framework/impl/document/doc-container-impl.js +21 -0
  138. package/lib/framework/impl/document/doc-container-impl.js.map +1 -0
  139. package/lib/framework/impl/document/doc-footer-impl.d.ts +26 -0
  140. package/lib/framework/impl/document/doc-footer-impl.js +77 -0
  141. package/lib/framework/impl/document/doc-footer-impl.js.map +1 -0
  142. package/lib/framework/impl/document/doc-header-impl.d.ts +26 -0
  143. package/lib/framework/impl/document/doc-header-impl.js +83 -0
  144. package/lib/framework/impl/document/doc-header-impl.js.map +1 -0
  145. package/lib/framework/impl/document/doc-impl.d.ts +61 -0
  146. package/lib/framework/impl/document/doc-impl.js +209 -0
  147. package/lib/framework/impl/document/doc-impl.js.map +1 -0
  148. package/lib/framework/impl/media-formula/menstrual-history.d.ts +35 -0
  149. package/lib/framework/impl/media-formula/menstrual-history.js +153 -0
  150. package/lib/framework/impl/media-formula/menstrual-history.js.map +1 -0
  151. package/lib/framework/impl/paragraph/p-impl.d.ts +45 -0
  152. package/lib/framework/impl/paragraph/p-impl.js +156 -0
  153. package/lib/framework/impl/paragraph/p-impl.js.map +1 -0
  154. package/lib/framework/impl/picture/image-impl.d.ts +31 -0
  155. package/lib/framework/impl/picture/image-impl.js +124 -0
  156. package/lib/framework/impl/picture/image-impl.js.map +1 -0
  157. package/lib/framework/impl/radio/radio-impl.d.ts +22 -0
  158. package/lib/framework/impl/radio/radio-impl.js +72 -0
  159. package/lib/framework/impl/radio/radio-impl.js.map +1 -0
  160. package/lib/framework/impl/symbol/br-symbol-impl.d.ts +22 -0
  161. package/lib/framework/impl/symbol/br-symbol-impl.js +54 -0
  162. package/lib/framework/impl/symbol/br-symbol-impl.js.map +1 -0
  163. package/lib/framework/impl/symbol/p-symbol-impl.d.ts +19 -0
  164. package/lib/framework/impl/symbol/p-symbol-impl.js +54 -0
  165. package/lib/framework/impl/symbol/p-symbol-impl.js.map +1 -0
  166. package/lib/framework/impl/table/table-cell-impl.d.ts +37 -0
  167. package/lib/framework/impl/table/table-cell-impl.js +145 -0
  168. package/lib/framework/impl/table/table-cell-impl.js.map +1 -0
  169. package/lib/framework/impl/table/table-impl.d.ts +55 -0
  170. package/lib/framework/impl/table/table-impl.js +363 -0
  171. package/lib/framework/impl/table/table-impl.js.map +1 -0
  172. package/lib/framework/impl/table/table-row-impl.d.ts +26 -0
  173. package/lib/framework/impl/table/table-row-impl.js +75 -0
  174. package/lib/framework/impl/table/table-row-impl.js.map +1 -0
  175. package/lib/framework/impl/table/table-split-cell-patch.d.ts +20 -0
  176. package/lib/framework/impl/table/table-split-cell-patch.js +89 -0
  177. package/lib/framework/impl/table/table-split-cell-patch.js.map +1 -0
  178. package/lib/framework/impl/table/table-split-cell.d.ts +90 -0
  179. package/lib/framework/impl/table/table-split-cell.js +464 -0
  180. package/lib/framework/impl/table/table-split-cell.js.map +1 -0
  181. package/lib/framework/impl/table/table-util.d.ts +150 -0
  182. package/lib/framework/impl/table/table-util.js +678 -0
  183. package/lib/framework/impl/table/table-util.js.map +1 -0
  184. package/lib/framework/impl/text/text-impl.d.ts +32 -0
  185. package/lib/framework/impl/text/text-impl.js +149 -0
  186. package/lib/framework/impl/text/text-impl.js.map +1 -0
  187. package/lib/framework/impl/text/track-run-impl.d.ts +27 -0
  188. package/lib/framework/impl/text/track-run-impl.js +112 -0
  189. package/lib/framework/impl/text/track-run-impl.js.map +1 -0
  190. package/lib/framework/notify.d.ts +13 -0
  191. package/lib/framework/notify.js +116 -0
  192. package/lib/framework/notify.js.map +1 -0
  193. package/lib/framework/range-util.d.ts +40 -0
  194. package/lib/framework/range-util.js +312 -0
  195. package/lib/framework/range-util.js.map +1 -0
  196. package/lib/framework/render-context.d.ts +91 -0
  197. package/lib/framework/render-context.js +384 -0
  198. package/lib/framework/render-context.js.map +1 -0
  199. package/lib/framework/render-define.d.ts +109 -0
  200. package/lib/framework/render-define.js +195 -0
  201. package/lib/framework/render-define.js.map +1 -0
  202. package/lib/framework/selection-overlays.d.ts +30 -0
  203. package/lib/framework/selection-overlays.js +124 -0
  204. package/lib/framework/selection-overlays.js.map +1 -0
  205. package/lib/texteditor.d.ts +318 -0
  206. package/lib/texteditor.js +913 -0
  207. package/lib/texteditor.js.map +1 -0
  208. package/lib/util/subject.d.ts +34 -0
  209. package/lib/util/subject.js +88 -0
  210. package/lib/util/subject.js.map +1 -0
  211. package/lib/util/table-bind.d.ts +5 -0
  212. package/lib/util/table-bind.js +6 -0
  213. package/lib/util/table-bind.js.map +1 -0
  214. package/package.json +1 -1
  215. package/tsconfig.json +1 -1
  216. package/webpack.config.js +0 -1
@@ -0,0 +1,809 @@
1
+ export class INotifyPropertyChanged {
2
+ __attatchProperty = {};
3
+ registerProperty(propertyName, value) {
4
+ this.__attatchProperty[propertyName] = value;
5
+ }
6
+ removeProperty(propertyName) {
7
+ delete this.__attatchProperty[propertyName];
8
+ }
9
+ getProperty(propertyName) {
10
+ return this.__attatchProperty[propertyName];
11
+ }
12
+ }
13
+ export class TextProps extends INotifyPropertyChanged {
14
+ constructor() {
15
+ super();
16
+ }
17
+ color;
18
+ fontName;
19
+ fontSize;
20
+ fontWeight = 'normal';
21
+ fontStyle = 'normal';
22
+ //textDecoration: 'none' | 'underline' | 'overline' | 'line-through' = 'none';
23
+ underline = false;
24
+ overline = false;
25
+ linethrough = false;
26
+ background;
27
+ letterSpace;
28
+ /**
29
+ * 上标或者下标
30
+ */
31
+ vertAlign;
32
+ /**
33
+ * 字符边框
34
+ */
35
+ border;
36
+ clearCache() {
37
+ this.__cacheFont = null;
38
+ }
39
+ clone(source) {
40
+ const clone = source ?? new TextProps();
41
+ this.setPropsValue(this, clone);
42
+ return clone;
43
+ }
44
+ setPropsValue(source, target) {
45
+ target.color = source.color;
46
+ target.fontName = source.fontName;
47
+ target.fontSize = source.fontSize;
48
+ target.fontWeight = source.fontWeight;
49
+ target.fontStyle = source.fontStyle;
50
+ target.underline = source.underline;
51
+ target.overline = source.overline;
52
+ target.linethrough = source.linethrough;
53
+ target.background = source.background;
54
+ target.letterSpace = source.letterSpace;
55
+ target.vertAlign = source.vertAlign;
56
+ target.border = source.border;
57
+ }
58
+ getSerializeProps(viewOptions) {
59
+ const props = {};
60
+ if (this.color && this.color !== viewOptions.defaultColor) {
61
+ props["color"] = this.color;
62
+ }
63
+ if (this.fontName && this.fontName !== viewOptions.defaultFontName) {
64
+ props["fontName"] = this.fontName;
65
+ }
66
+ if (this.fontSize !== viewOptions.defaultFontSize) {
67
+ props["fontSize"] = this.fontSize;
68
+ }
69
+ if (this.fontWeight && this.fontWeight !== "normal") {
70
+ props["fontWeight"] = this.fontWeight;
71
+ }
72
+ if (this.underline) {
73
+ props["underline"] = this.underline;
74
+ }
75
+ if (this.overline) {
76
+ props["overline"] = this.overline;
77
+ }
78
+ if (this.linethrough) {
79
+ props["linethrough"] = this.linethrough;
80
+ }
81
+ if (this.background) {
82
+ props["background"] = this.background;
83
+ }
84
+ if (this.letterSpace) {
85
+ props["letterSpace"] = this.letterSpace;
86
+ }
87
+ if (this.fontStyle && this.fontStyle !== 'normal') {
88
+ props["fontStyle"] = this.fontStyle;
89
+ }
90
+ if (this.vertAlign) {
91
+ props["vertAlign"] = this.vertAlign;
92
+ }
93
+ if (this.border) {
94
+ props["border"] = this.border;
95
+ }
96
+ return props;
97
+ }
98
+ __cacheFont;
99
+ getFont() {
100
+ if (this.__cacheFont) {
101
+ return this.__cacheFont;
102
+ }
103
+ else {
104
+ let fontStr = '';
105
+ if (this.fontStyle && this.fontStyle !== 'normal') {
106
+ fontStr += this.fontStyle + ' ';
107
+ }
108
+ if (this.fontWeight && this.fontWeight !== 'normal') {
109
+ fontStr += this.fontWeight + ' ';
110
+ }
111
+ //当前存在上标或者下标,大小为3/5
112
+ fontStr += (this.vertAlign ? this.fontSize * 3 / 5 : this.fontSize) + 'px ';
113
+ fontStr += fontMapFunc.getFontMap(this.fontName);
114
+ this.__cacheFont = fontStr;
115
+ return this.__cacheFont;
116
+ }
117
+ }
118
+ equals(props) {
119
+ return this.background === props.background
120
+ && this.color === props.color
121
+ && this.fontName === props.fontName
122
+ && this.fontSize === props.fontSize
123
+ && this.fontWeight === props.fontWeight
124
+ && this.letterSpace === props.letterSpace
125
+ && this.underline === props.underline
126
+ && this.overline === props.overline
127
+ && this.linethrough === props.linethrough
128
+ && this.fontStyle === props.fontStyle
129
+ && this.vertAlign === props.vertAlign
130
+ && this.border === props.border;
131
+ }
132
+ }
133
+ export class ParagraphProps extends INotifyPropertyChanged {
134
+ //段落默认的文本属性
135
+ textProps;
136
+ indent = 0;
137
+ hanging = 0;
138
+ lineHeight = 1.3;
139
+ textAlign = 'left';
140
+ numberType = -1;
141
+ pageBreak = false;
142
+ clone(dest = null) {
143
+ const clone = dest ?? new ParagraphProps();
144
+ clone.indent = this.indent;
145
+ clone.numberType = this.numberType;
146
+ clone.lineHeight = this.lineHeight;
147
+ clone.textAlign = this.textAlign;
148
+ clone.textProps = this.textProps.clone(new TextProps());
149
+ //强制换页属性不可复制
150
+ //clone.pageBreak=this.pageBreak;
151
+ return clone;
152
+ }
153
+ getSerializeProps(viewOptions) {
154
+ const props = {};
155
+ if (this.indent) {
156
+ props["indent"] = this.indent;
157
+ }
158
+ if (this.hanging) {
159
+ props["hanging"] = this.hanging;
160
+ }
161
+ if (this.lineHeight && this.lineHeight !== 1.3) {
162
+ props["lineHeight"] = this.lineHeight;
163
+ }
164
+ if (this.textAlign && this.textAlign !== "left") {
165
+ props["textAlign"] = this.textAlign;
166
+ }
167
+ if (this.numberType !== -1) {
168
+ props["numberType"] = this.numberType;
169
+ }
170
+ if (this.textProps) {
171
+ const dt = this.textProps.getSerializeProps(viewOptions);
172
+ if (Object.keys(dt).length) {
173
+ props["textProps"] = dt;
174
+ }
175
+ }
176
+ if (this.pageBreak) {
177
+ props["pageBreak"] = this.pageBreak;
178
+ }
179
+ return props;
180
+ }
181
+ }
182
+ export class DocumentProps extends INotifyPropertyChanged {
183
+ width;
184
+ height;
185
+ padding;
186
+ headerLine = 12;
187
+ footerLine = 12;
188
+ orient = 'portrait';
189
+ createUserId;
190
+ createUserName;
191
+ createDate;
192
+ scripts;
193
+ clone(dest) {
194
+ const clone = dest ?? new DocumentProps();
195
+ clone.width = this.width;
196
+ clone.height = this.height;
197
+ clone.padding = this.padding.clone();
198
+ clone.headerLine = this.headerLine;
199
+ clone.footerLine = this.footerLine;
200
+ clone.scripts = this.scripts;
201
+ clone.createUserId = this.createUserId;
202
+ clone.createUserName = this.createUserName;
203
+ clone.createDate = this.createDate;
204
+ clone.orient = this.orient;
205
+ return clone;
206
+ }
207
+ getSerializeProps() {
208
+ const props = {
209
+ width: this.width,
210
+ height: this.height,
211
+ padding: this.padding,
212
+ headerLine: this.headerLine,
213
+ footerLine: this.footerLine,
214
+ createDate: this.createDate,
215
+ createUserName: this.createUserName,
216
+ createUserId: this.createUserId
217
+ };
218
+ if (this.scripts) {
219
+ props['scripts'] = this.scripts;
220
+ }
221
+ if (this.orient && this.orient !== 'portrait') {
222
+ props['orient'] = this.orient;
223
+ }
224
+ return props;
225
+ }
226
+ }
227
+ export class CheckBoxProps extends INotifyPropertyChanged {
228
+ size;
229
+ isChecked;
230
+ //用于复选框分组
231
+ groupName;
232
+ clone(dest) {
233
+ const clone = dest ?? new CheckBoxProps();
234
+ clone.size = this.size;
235
+ clone.isChecked = this.isChecked;
236
+ clone.groupName = this.groupName;
237
+ return clone;
238
+ }
239
+ getSerializeProps(viewOptions) {
240
+ return {
241
+ size: this.size,
242
+ isChecked: this.isChecked,
243
+ groupName: this.groupName,
244
+ };
245
+ }
246
+ }
247
+ export class RadioBoxProps extends INotifyPropertyChanged {
248
+ size;
249
+ isChecked;
250
+ clone(dest) {
251
+ const clone = dest ?? new RadioBoxProps();
252
+ clone.size = this.size;
253
+ clone.isChecked = this.isChecked;
254
+ return clone;
255
+ }
256
+ getSerializeProps(viewOptions) {
257
+ return {
258
+ size: this.size,
259
+ isCheced: this.isChecked
260
+ };
261
+ }
262
+ }
263
+ export class TableRowProps extends INotifyPropertyChanged {
264
+ minHeight;
265
+ headerRow;
266
+ clone(dest) {
267
+ const clone = dest ?? new TableRowProps();
268
+ clone.minHeight = this.minHeight;
269
+ clone.headerRow = this.headerRow;
270
+ return clone;
271
+ }
272
+ getSerializeProps(viewOptions) {
273
+ const props = {};
274
+ if (this.minHeight > 0) {
275
+ props["minHeight"] = this.minHeight;
276
+ props["headerRow"] = this.headerRow;
277
+ }
278
+ if (this.headerRow) {
279
+ props['headerRow'] = this.headerRow;
280
+ }
281
+ return props;
282
+ }
283
+ }
284
+ export class TableProps extends INotifyPropertyChanged {
285
+ //auto 或者具体的值
286
+ width;
287
+ cols;
288
+ alignment;
289
+ border = 'all';
290
+ allowBreakRow;
291
+ clone(dest) {
292
+ const clone = dest ?? new TableProps();
293
+ clone.width = this.width;
294
+ clone.cols = [...this.cols];
295
+ clone.alignment = this.alignment;
296
+ clone.border = this.border;
297
+ return clone;
298
+ }
299
+ getSerializeProps(viewOptions) {
300
+ return {
301
+ width: this.width,
302
+ cols: this.cols,
303
+ alignment: this.alignment,
304
+ border: this.border
305
+ };
306
+ }
307
+ }
308
+ export class TableCellProps extends INotifyPropertyChanged {
309
+ vMerge;
310
+ hMerge;
311
+ vAlign;
312
+ backgroundColor;
313
+ /**
314
+ * 对角线
315
+ */
316
+ diagonal;
317
+ clone(dest) {
318
+ const clone = dest ?? new TableCellProps();
319
+ clone.vMerge = this.vMerge;
320
+ clone.hMerge = this.hMerge;
321
+ clone.vAlign = this.vAlign;
322
+ clone.backgroundColor = this.backgroundColor;
323
+ clone.diagonal = this.diagonal;
324
+ return clone;
325
+ }
326
+ getSerializeProps(options) {
327
+ const props = {};
328
+ if (this.vMerge) {
329
+ props['vMerge'] = this.vMerge;
330
+ }
331
+ if (this.hMerge) {
332
+ props['hMerge'] = this.hMerge;
333
+ }
334
+ if (this.vAlign && this.vAlign !== 'top') {
335
+ props['vAlign'] = this.vAlign;
336
+ }
337
+ if (this.backgroundColor) {
338
+ props['backgroundColor'] = this.backgroundColor;
339
+ }
340
+ if (this.diagonal) {
341
+ props['diagonal'] = this.diagonal;
342
+ }
343
+ return props;
344
+ }
345
+ }
346
+ export class PictureProps extends INotifyPropertyChanged {
347
+ title;
348
+ width;
349
+ height;
350
+ src;
351
+ border;
352
+ clone(dest) {
353
+ const clone = dest ?? new PictureProps();
354
+ clone.width = this.width;
355
+ clone.height = this.height;
356
+ clone.src = this.src;
357
+ clone.border = this.border;
358
+ clone.title = this.title;
359
+ return clone;
360
+ }
361
+ getSerializeProps(viewOptions) {
362
+ const props = {
363
+ width: this.width,
364
+ height: this.height,
365
+ src: this.src,
366
+ border: this.border,
367
+ };
368
+ if (this.title) {
369
+ props['title'] = this.title;
370
+ }
371
+ return props;
372
+ }
373
+ }
374
+ export class DataDecorateProps extends INotifyPropertyChanged {
375
+ content;
376
+ size;
377
+ clone(dest) {
378
+ const clone = dest ?? new DataDecorateProps();
379
+ clone.content = this.content;
380
+ clone.size = this.size;
381
+ return clone;
382
+ }
383
+ getSerializeProps(viewOptions) {
384
+ return {
385
+ size: this.size,
386
+ content: this.content
387
+ };
388
+ }
389
+ }
390
+ export class DataEleBaseProps extends INotifyPropertyChanged {
391
+ id;
392
+ name;
393
+ fieldName;
394
+ caption;
395
+ required;
396
+ printable;
397
+ secretBrowse;
398
+ editable;
399
+ deleteable;
400
+ minLength;
401
+ type;
402
+ underline;
403
+ cloneBaseProps(destProps) {
404
+ this.setPropValue(this, destProps);
405
+ }
406
+ setPropValue(source, target) {
407
+ target.id = source.id;
408
+ target.name = source.name;
409
+ target.caption = source.caption;
410
+ target.fieldName = source.fieldName;
411
+ target.required = source.required;
412
+ target.editable = source.editable;
413
+ target.deleteable = source.deleteable;
414
+ target.secretBrowse = source.secretBrowse;
415
+ target.printable = source.printable;
416
+ target.minLength = source.minLength;
417
+ target.type = source.type;
418
+ target.underline = source.underline;
419
+ }
420
+ updateProps(props) {
421
+ this.setPropValue(props, this);
422
+ }
423
+ getBaseProps(props, options) {
424
+ props["id"] = this.id;
425
+ props["name"] = this.name;
426
+ props["fieldName"] = this.fieldName;
427
+ props["type"] = this.type;
428
+ if (this.caption) {
429
+ props["caption"] = this.caption;
430
+ }
431
+ if (this.required) {
432
+ props["required"] = this.required;
433
+ }
434
+ if (this.printable) {
435
+ props["printable"] = this.printable;
436
+ }
437
+ if (this.secretBrowse) {
438
+ props["secretBrowse"] = this.secretBrowse;
439
+ }
440
+ if (!this.editable) {
441
+ props['editable'] = this.editable;
442
+ }
443
+ if (this.deleteable) {
444
+ props["deleteable"] = this.deleteable;
445
+ }
446
+ if (this.minLength) {
447
+ props["minLength"] = this.minLength;
448
+ }
449
+ if (this.underline) {
450
+ props["underline"] = this.underline;
451
+ }
452
+ return props;
453
+ }
454
+ getSerializeProps(viewOptions) {
455
+ throw new Error('未实现');
456
+ }
457
+ }
458
+ export class DataEleBaseTextProps extends DataEleBaseProps {
459
+ constructor() {
460
+ super();
461
+ super.type = 'text';
462
+ }
463
+ valueTextProps;
464
+ nullText;
465
+ nullTextProps;
466
+ dataType = 'text';
467
+ clone(dest = null) {
468
+ const clone = dest ?? new DataEleBaseTextProps();
469
+ super.cloneBaseProps(clone);
470
+ clone.valueTextProps = this.valueTextProps.clone(null);
471
+ clone.nullText = this.nullText;
472
+ clone.nullTextProps = this.nullTextProps.clone(null);
473
+ return clone;
474
+ }
475
+ getSerializeProps(options) {
476
+ const props = {
477
+ type: this.type,
478
+ valueTextProps: this.valueTextProps.getSerializeProps(options),
479
+ nullText: this.nullText,
480
+ nullTextProps: this.nullTextProps.getSerializeProps(options)
481
+ };
482
+ if (this.dataType && this.dataType !== 'text') {
483
+ props['dataType'] = this.dataType;
484
+ }
485
+ this.getBaseProps(props, options);
486
+ return props;
487
+ }
488
+ getBaseProps(props, options) {
489
+ super.getBaseProps(props, options);
490
+ props['valueTextProps'] = this.valueTextProps.getSerializeProps(options);
491
+ props['nullTextProps'] = this.nullTextProps.getSerializeProps(options);
492
+ props['nullText'] = this.nullText;
493
+ props['dataType'] = this.dataType;
494
+ return props;
495
+ }
496
+ updateProps(props) {
497
+ super.updateProps(props);
498
+ this.valueTextProps = props.valueTextProps;
499
+ this.nullText = props.nullText;
500
+ this.nullTextProps = props.nullTextProps;
501
+ this.dataType = props.dataType;
502
+ }
503
+ }
504
+ export class DataEleListProps extends DataEleBaseTextProps {
505
+ constructor() {
506
+ super();
507
+ super.type = 'droplist';
508
+ }
509
+ options = [];
510
+ dropDownStyle;
511
+ /**
512
+ * 是否允许多选
513
+ */
514
+ multiSelect;
515
+ clone(dest) {
516
+ const clone = dest ?? new DataEleListProps();
517
+ super.clone(clone);
518
+ clone.options = [...this.options];
519
+ clone.dropDownStyle = this.dropDownStyle;
520
+ clone.multiSelect = this.multiSelect;
521
+ return clone;
522
+ }
523
+ getSerializeProps(options) {
524
+ const props = {
525
+ options: [...this.options],
526
+ multiSelect: this.multiSelect,
527
+ dropDownStyle: this.dropDownStyle,
528
+ };
529
+ super.getBaseProps(props, options);
530
+ return props;
531
+ }
532
+ updateProps(props) {
533
+ super.updateProps(props);
534
+ this.options = props.options;
535
+ this.multiSelect = props.multiSelect;
536
+ this.dropDownStyle = props.dropDownStyle;
537
+ }
538
+ }
539
+ export class CommContentProps extends INotifyPropertyChanged {
540
+ id;
541
+ createId;
542
+ createName;
543
+ createDate;
544
+ clone(dest) {
545
+ const clone = dest ?? new CommContentProps();
546
+ clone.id = this.id;
547
+ return clone;
548
+ }
549
+ getSerializeProps(viewOptions) {
550
+ return {
551
+ id: this.id
552
+ };
553
+ }
554
+ }
555
+ export class CommProps extends INotifyPropertyChanged {
556
+ id;
557
+ markType;
558
+ clone(dest) {
559
+ const clone = dest ?? new CommProps();
560
+ clone.id = this.id;
561
+ clone.markType = this.markType;
562
+ return clone;
563
+ }
564
+ getSerializeProps(viewOptions) {
565
+ return {
566
+ id: this.id,
567
+ markType: this.markType
568
+ };
569
+ }
570
+ }
571
+ export class DataEleCheckProps extends DataEleBaseProps {
572
+ constructor() {
573
+ super();
574
+ super.type = 'check';
575
+ }
576
+ size;
577
+ checked;
578
+ checkedValue = '';
579
+ groupName;
580
+ multiSelect = false;
581
+ clone(dest) {
582
+ const clone = dest ?? new DataEleCheckProps();
583
+ super.cloneBaseProps(clone);
584
+ clone.checked = this.checked;
585
+ clone.size = this.size;
586
+ clone.groupName = this.groupName;
587
+ clone.multiSelect = this.multiSelect;
588
+ clone.checkedValue = this.checkedValue;
589
+ return clone;
590
+ }
591
+ getSerializeProps(options) {
592
+ const props = {
593
+ checked: this.checked,
594
+ size: this.size,
595
+ groupName: this.groupName,
596
+ multiSelect: this.multiSelect,
597
+ checkedValue: this.checkedValue
598
+ };
599
+ this.getBaseProps(props, options);
600
+ return props;
601
+ }
602
+ updateProps(props) {
603
+ super.updateProps(props);
604
+ this.checked = props.checked;
605
+ this.size = props.size;
606
+ this.groupName = props.groupName;
607
+ this.multiSelect = props.multiSelect;
608
+ this.checkedValue = props.checkedValue;
609
+ }
610
+ }
611
+ export class DataEleImageProps extends DataEleBaseProps {
612
+ constructor() {
613
+ super();
614
+ super.type = 'img';
615
+ }
616
+ width;
617
+ height;
618
+ src;
619
+ border;
620
+ clone(dest) {
621
+ const clone = dest ?? new DataEleImageProps();
622
+ this.cloneBaseProps(clone);
623
+ clone.width = this.width;
624
+ clone.height = this.height;
625
+ clone.src = this.src;
626
+ clone.border = this.border;
627
+ return clone;
628
+ }
629
+ getSerializeProps(options) {
630
+ const props = {
631
+ width: this.width,
632
+ height: this.height,
633
+ src: this.src,
634
+ border: this.border
635
+ };
636
+ this.getBaseProps(props, options);
637
+ return props;
638
+ }
639
+ updateProps(props) {
640
+ super.updateProps(props);
641
+ this.width = props.width;
642
+ this.height = props.height;
643
+ this.src = props.src;
644
+ this.border = props.border;
645
+ }
646
+ }
647
+ export class DataEleDateProps extends DataEleBaseTextProps {
648
+ constructor() {
649
+ super();
650
+ super.type = 'date';
651
+ }
652
+ minValue;
653
+ maxValue;
654
+ format;
655
+ clone(dest) {
656
+ const clone = dest ?? new DataEleDateProps();
657
+ super.clone(clone);
658
+ clone.minValue = this.minValue;
659
+ clone.maxValue = this.maxValue;
660
+ clone.format = this.format;
661
+ return clone;
662
+ }
663
+ getSerializeProps(options) {
664
+ const props = {
665
+ minValue: this.minValue,
666
+ maxValue: this.maxValue,
667
+ format: this.format
668
+ };
669
+ this.getBaseProps(props, options);
670
+ return props;
671
+ }
672
+ updateProps(props) {
673
+ super.updateProps(props);
674
+ this.minValue = props.minValue;
675
+ this.maxValue = props.maxValue;
676
+ this.format = props.format;
677
+ }
678
+ }
679
+ export class ValidateCondition {
680
+ required = false;
681
+ maxLength = -1;
682
+ dataType = 'string';
683
+ }
684
+ export class DataEleMHProps extends DataEleBaseProps {
685
+ //初潮年龄
686
+ age;
687
+ //行经期天数
688
+ days;
689
+ //月经周期天数
690
+ cycles;
691
+ //末次月经时间
692
+ lastDate;
693
+ //闭经年龄
694
+ closeAge;
695
+ kind;
696
+ clone(dest) {
697
+ const clone = dest ?? new DataEleMHProps();
698
+ this.cloneBaseProps(clone);
699
+ clone.age = this.age;
700
+ clone.days = this.days;
701
+ clone.cycles = this.cycles;
702
+ clone.lastDate = this.lastDate;
703
+ clone.closeAge = this.closeAge;
704
+ clone.kind = this.kind;
705
+ return clone;
706
+ }
707
+ getSerializeProps(options) {
708
+ const props = {
709
+ age: this.age,
710
+ days: this.days,
711
+ cycles: this.cycles,
712
+ lastDate: this.lastDate,
713
+ closeAge: this.closeAge,
714
+ kind: this.kind
715
+ };
716
+ this.getBaseProps(props, options);
717
+ return props;
718
+ }
719
+ }
720
+ export class TrackRunProps {
721
+ type;
722
+ userId;
723
+ userName;
724
+ date;
725
+ id;
726
+ constructor(type) {
727
+ this.type = type;
728
+ }
729
+ clone(dest) {
730
+ dest = dest ?? new TrackRunProps(this.type);
731
+ dest.userId = this.userId;
732
+ dest.userName = this.userName;
733
+ dest.date = this.date;
734
+ dest.id = this.id;
735
+ }
736
+ getSerializeProps() {
737
+ const props = {
738
+ userId: this.userId,
739
+ userName: this.userName,
740
+ date: this.date,
741
+ id: this.id
742
+ };
743
+ return props;
744
+ }
745
+ }
746
+ class FontMapStruct {
747
+ fontMap = new Map();
748
+ length = 0;
749
+ registerFontMap(name, keyName) {
750
+ this.fontMap.set(name, keyName);
751
+ this.length = this.fontMap.size;
752
+ }
753
+ getFontMap(name) {
754
+ if (this.length === 0) {
755
+ return name;
756
+ }
757
+ if (this.fontMap.has(name)) {
758
+ let key = this.fontMap.get(name);
759
+ return key;
760
+ }
761
+ return name;
762
+ }
763
+ }
764
+ export const fontMapFunc = new FontMapStruct();
765
+ export class ValidateProps {
766
+ id;
767
+ title;
768
+ msg;
769
+ }
770
+ export class DataElementGroupProps {
771
+ id;
772
+ name;
773
+ clone(dest) {
774
+ dest = dest ?? new DataElementGroupProps();
775
+ dest.id = this.id;
776
+ dest.name = this.name;
777
+ }
778
+ getSerializeProps() {
779
+ return {
780
+ id: this.id,
781
+ name: this.name
782
+ };
783
+ }
784
+ }
785
+ export class DataElementBarcodeProps {
786
+ type = 'code128';
787
+ text = '';
788
+ width = 0;
789
+ height = 0;
790
+ clone(dest) {
791
+ dest = dest ?? new DataElementBarcodeProps();
792
+ dest.type = this.type;
793
+ dest.text = this.text;
794
+ dest.width = this.width;
795
+ dest.height = this.height;
796
+ }
797
+ getSerializeProps() {
798
+ return {
799
+ type: this.type,
800
+ text: this.text,
801
+ width: this.width,
802
+ height: this.height
803
+ };
804
+ }
805
+ }
806
+ export class BodyPartProps {
807
+ partId;
808
+ }
809
+ //# sourceMappingURL=element-props.js.map