@hailin-zheng/editor-core 1.0.1 → 1.0.5

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/package.json +1 -1
  2. package/tsconfig.json +1 -1
  3. package/webpack.config.js +0 -1
  4. package/dist/doc-ruler.d.ts +0 -51
  5. package/dist/doc-ruler.js +0 -313
  6. package/dist/doc-ruler.js.map +0 -1
  7. package/dist/framework/common-util.d.ts +0 -63
  8. package/dist/framework/common-util.js +0 -178
  9. package/dist/framework/common-util.js.map +0 -1
  10. package/dist/framework/document-change.d.ts +0 -265
  11. package/dist/framework/document-change.js +0 -1342
  12. package/dist/framework/document-change.js.map +0 -1
  13. package/dist/framework/document-combine.d.ts +0 -24
  14. package/dist/framework/document-combine.js +0 -40
  15. package/dist/framework/document-combine.js.map +0 -1
  16. package/dist/framework/document-comment.d.ts +0 -46
  17. package/dist/framework/document-comment.js +0 -148
  18. package/dist/framework/document-comment.js.map +0 -1
  19. package/dist/framework/document-context.d.ts +0 -149
  20. package/dist/framework/document-context.js +0 -330
  21. package/dist/framework/document-context.js.map +0 -1
  22. package/dist/framework/document-eval-func.d.ts +0 -18
  23. package/dist/framework/document-eval-func.js +0 -48
  24. package/dist/framework/document-eval-func.js.map +0 -1
  25. package/dist/framework/document-event.d.ts +0 -213
  26. package/dist/framework/document-event.js +0 -1054
  27. package/dist/framework/document-event.js.map +0 -1
  28. package/dist/framework/document-history.d.ts +0 -26
  29. package/dist/framework/document-history.js +0 -65
  30. package/dist/framework/document-history.js.map +0 -1
  31. package/dist/framework/document-images-loader.d.ts +0 -16
  32. package/dist/framework/document-images-loader.js +0 -66
  33. package/dist/framework/document-images-loader.js.map +0 -1
  34. package/dist/framework/document-input-cursor.d.ts +0 -78
  35. package/dist/framework/document-input-cursor.js +0 -239
  36. package/dist/framework/document-input-cursor.js.map +0 -1
  37. package/dist/framework/document-paint.d.ts +0 -34
  38. package/dist/framework/document-paint.js +0 -103
  39. package/dist/framework/document-paint.js.map +0 -1
  40. package/dist/framework/document-print-offscreen.d.ts +0 -38
  41. package/dist/framework/document-print-offscreen.js +0 -128
  42. package/dist/framework/document-print-offscreen.js.map +0 -1
  43. package/dist/framework/document-print.d.ts +0 -60
  44. package/dist/framework/document-print.js +0 -203
  45. package/dist/framework/document-print.js.map +0 -1
  46. package/dist/framework/document-segmenter.d.ts +0 -2
  47. package/dist/framework/document-segmenter.js +0 -106
  48. package/dist/framework/document-segmenter.js.map +0 -1
  49. package/dist/framework/document-selection.d.ts +0 -89
  50. package/dist/framework/document-selection.js +0 -358
  51. package/dist/framework/document-selection.js.map +0 -1
  52. package/dist/framework/document-template.d.ts +0 -4
  53. package/dist/framework/document-template.js +0 -20
  54. package/dist/framework/document-template.js.map +0 -1
  55. package/dist/framework/document-textline-mode.d.ts +0 -7
  56. package/dist/framework/document-textline-mode.js +0 -30
  57. package/dist/framework/document-textline-mode.js.map +0 -1
  58. package/dist/framework/element-define.d.ts +0 -319
  59. package/dist/framework/element-define.js +0 -579
  60. package/dist/framework/element-define.js.map +0 -1
  61. package/dist/framework/element-event-define.d.ts +0 -99
  62. package/dist/framework/element-event-define.js +0 -108
  63. package/dist/framework/element-event-define.js.map +0 -1
  64. package/dist/framework/element-measure.d.ts +0 -97
  65. package/dist/framework/element-measure.js +0 -551
  66. package/dist/framework/element-measure.js.map +0 -1
  67. package/dist/framework/element-paint.d.ts +0 -42
  68. package/dist/framework/element-paint.js +0 -170
  69. package/dist/framework/element-paint.js.map +0 -1
  70. package/dist/framework/element-props.d.ts +0 -301
  71. package/dist/framework/element-props.js +0 -809
  72. package/dist/framework/element-props.js.map +0 -1
  73. package/dist/framework/element-reader.d.ts +0 -19
  74. package/dist/framework/element-reader.js +0 -151
  75. package/dist/framework/element-reader.js.map +0 -1
  76. package/dist/framework/element-render-cut.d.ts +0 -55
  77. package/dist/framework/element-render-cut.js +0 -449
  78. package/dist/framework/element-render-cut.js.map +0 -1
  79. package/dist/framework/element-serialize.d.ts +0 -30
  80. package/dist/framework/element-serialize.js +0 -113
  81. package/dist/framework/element-serialize.js.map +0 -1
  82. package/dist/framework/element-util.d.ts +0 -369
  83. package/dist/framework/element-util.js +0 -1463
  84. package/dist/framework/element-util.js.map +0 -1
  85. package/dist/framework/impl/checkbox/checkbox-impl.d.ts +0 -24
  86. package/dist/framework/impl/checkbox/checkbox-impl.js +0 -64
  87. package/dist/framework/impl/checkbox/checkbox-impl.js.map +0 -1
  88. package/dist/framework/impl/comments/comment-content-impl.d.ts +0 -40
  89. package/dist/framework/impl/comments/comment-content-impl.js +0 -105
  90. package/dist/framework/impl/comments/comment-content-impl.js.map +0 -1
  91. package/dist/framework/impl/comments/comment-element-impl.d.ts +0 -21
  92. package/dist/framework/impl/comments/comment-element-impl.js +0 -62
  93. package/dist/framework/impl/comments/comment-element-impl.js.map +0 -1
  94. package/dist/framework/impl/comments/comments-container-impl.d.ts +0 -22
  95. package/dist/framework/impl/comments/comments-container-impl.js +0 -62
  96. package/dist/framework/impl/comments/comments-container-impl.js.map +0 -1
  97. package/dist/framework/impl/comments/comments-util.d.ts +0 -12
  98. package/dist/framework/impl/comments/comments-util.js +0 -67
  99. package/dist/framework/impl/comments/comments-util.js.map +0 -1
  100. package/dist/framework/impl/comments/validate-msg-impl.d.ts +0 -21
  101. package/dist/framework/impl/comments/validate-msg-impl.js +0 -83
  102. package/dist/framework/impl/comments/validate-msg-impl.js.map +0 -1
  103. package/dist/framework/impl/data-element/data-decorate-impl.d.ts +0 -30
  104. package/dist/framework/impl/data-element/data-decorate-impl.js +0 -91
  105. package/dist/framework/impl/data-element/data-decorate-impl.js.map +0 -1
  106. package/dist/framework/impl/data-element/data-element-barcode.d.ts +0 -31
  107. package/dist/framework/impl/data-element/data-element-barcode.js +0 -115
  108. package/dist/framework/impl/data-element/data-element-barcode.js.map +0 -1
  109. package/dist/framework/impl/data-element/data-element-base-impl.d.ts +0 -68
  110. package/dist/framework/impl/data-element/data-element-base-impl.js +0 -205
  111. package/dist/framework/impl/data-element/data-element-base-impl.js.map +0 -1
  112. package/dist/framework/impl/data-element/data-element-check-impl.d.ts +0 -35
  113. package/dist/framework/impl/data-element/data-element-check-impl.js +0 -133
  114. package/dist/framework/impl/data-element/data-element-check-impl.js.map +0 -1
  115. package/dist/framework/impl/data-element/data-element-date-impl.d.ts +0 -23
  116. package/dist/framework/impl/data-element/data-element-date-impl.js +0 -111
  117. package/dist/framework/impl/data-element/data-element-date-impl.js.map +0 -1
  118. package/dist/framework/impl/data-element/data-element-group-impl.d.ts +0 -23
  119. package/dist/framework/impl/data-element/data-element-group-impl.js +0 -130
  120. package/dist/framework/impl/data-element/data-element-group-impl.js.map +0 -1
  121. package/dist/framework/impl/data-element/data-element-image-impl.d.ts +0 -30
  122. package/dist/framework/impl/data-element/data-element-image-impl.js +0 -137
  123. package/dist/framework/impl/data-element/data-element-image-impl.js.map +0 -1
  124. package/dist/framework/impl/data-element/data-element-list-impl.d.ts +0 -22
  125. package/dist/framework/impl/data-element/data-element-list-impl.js +0 -131
  126. package/dist/framework/impl/data-element/data-element-list-impl.js.map +0 -1
  127. package/dist/framework/impl/data-element/data-element-text-impl.d.ts +0 -23
  128. package/dist/framework/impl/data-element/data-element-text-impl.js +0 -103
  129. package/dist/framework/impl/data-element/data-element-text-impl.js.map +0 -1
  130. package/dist/framework/impl/decorate/fill-null-space-imple.d.ts +0 -21
  131. package/dist/framework/impl/decorate/fill-null-space-imple.js +0 -43
  132. package/dist/framework/impl/decorate/fill-null-space-imple.js.map +0 -1
  133. package/dist/framework/impl/document/doc-body-impl.d.ts +0 -27
  134. package/dist/framework/impl/document/doc-body-impl.js +0 -79
  135. package/dist/framework/impl/document/doc-body-impl.js.map +0 -1
  136. package/dist/framework/impl/document/doc-body-part-impl.d.ts +0 -30
  137. package/dist/framework/impl/document/doc-body-part-impl.js +0 -94
  138. package/dist/framework/impl/document/doc-body-part-impl.js.map +0 -1
  139. package/dist/framework/impl/document/doc-container-impl.d.ts +0 -16
  140. package/dist/framework/impl/document/doc-container-impl.js +0 -21
  141. package/dist/framework/impl/document/doc-container-impl.js.map +0 -1
  142. package/dist/framework/impl/document/doc-footer-impl.d.ts +0 -26
  143. package/dist/framework/impl/document/doc-footer-impl.js +0 -77
  144. package/dist/framework/impl/document/doc-footer-impl.js.map +0 -1
  145. package/dist/framework/impl/document/doc-header-impl.d.ts +0 -26
  146. package/dist/framework/impl/document/doc-header-impl.js +0 -83
  147. package/dist/framework/impl/document/doc-header-impl.js.map +0 -1
  148. package/dist/framework/impl/document/doc-impl.d.ts +0 -61
  149. package/dist/framework/impl/document/doc-impl.js +0 -209
  150. package/dist/framework/impl/document/doc-impl.js.map +0 -1
  151. package/dist/framework/impl/media-formula/menstrual-history.d.ts +0 -35
  152. package/dist/framework/impl/media-formula/menstrual-history.js +0 -153
  153. package/dist/framework/impl/media-formula/menstrual-history.js.map +0 -1
  154. package/dist/framework/impl/paragraph/p-impl.d.ts +0 -45
  155. package/dist/framework/impl/paragraph/p-impl.js +0 -156
  156. package/dist/framework/impl/paragraph/p-impl.js.map +0 -1
  157. package/dist/framework/impl/picture/image-impl.d.ts +0 -31
  158. package/dist/framework/impl/picture/image-impl.js +0 -124
  159. package/dist/framework/impl/picture/image-impl.js.map +0 -1
  160. package/dist/framework/impl/radio/radio-impl.d.ts +0 -22
  161. package/dist/framework/impl/radio/radio-impl.js +0 -72
  162. package/dist/framework/impl/radio/radio-impl.js.map +0 -1
  163. package/dist/framework/impl/symbol/br-symbol-impl.d.ts +0 -22
  164. package/dist/framework/impl/symbol/br-symbol-impl.js +0 -54
  165. package/dist/framework/impl/symbol/br-symbol-impl.js.map +0 -1
  166. package/dist/framework/impl/symbol/p-symbol-impl.d.ts +0 -19
  167. package/dist/framework/impl/symbol/p-symbol-impl.js +0 -54
  168. package/dist/framework/impl/symbol/p-symbol-impl.js.map +0 -1
  169. package/dist/framework/impl/table/table-cell-impl.d.ts +0 -37
  170. package/dist/framework/impl/table/table-cell-impl.js +0 -145
  171. package/dist/framework/impl/table/table-cell-impl.js.map +0 -1
  172. package/dist/framework/impl/table/table-impl.d.ts +0 -55
  173. package/dist/framework/impl/table/table-impl.js +0 -363
  174. package/dist/framework/impl/table/table-impl.js.map +0 -1
  175. package/dist/framework/impl/table/table-row-impl.d.ts +0 -26
  176. package/dist/framework/impl/table/table-row-impl.js +0 -75
  177. package/dist/framework/impl/table/table-row-impl.js.map +0 -1
  178. package/dist/framework/impl/table/table-split-cell-patch.d.ts +0 -20
  179. package/dist/framework/impl/table/table-split-cell-patch.js +0 -89
  180. package/dist/framework/impl/table/table-split-cell-patch.js.map +0 -1
  181. package/dist/framework/impl/table/table-split-cell.d.ts +0 -90
  182. package/dist/framework/impl/table/table-split-cell.js +0 -464
  183. package/dist/framework/impl/table/table-split-cell.js.map +0 -1
  184. package/dist/framework/impl/table/table-util.d.ts +0 -150
  185. package/dist/framework/impl/table/table-util.js +0 -678
  186. package/dist/framework/impl/table/table-util.js.map +0 -1
  187. package/dist/framework/impl/text/text-impl.d.ts +0 -32
  188. package/dist/framework/impl/text/text-impl.js +0 -149
  189. package/dist/framework/impl/text/text-impl.js.map +0 -1
  190. package/dist/framework/impl/text/track-run-impl.d.ts +0 -27
  191. package/dist/framework/impl/text/track-run-impl.js +0 -112
  192. package/dist/framework/impl/text/track-run-impl.js.map +0 -1
  193. package/dist/framework/notify.d.ts +0 -13
  194. package/dist/framework/notify.js +0 -116
  195. package/dist/framework/notify.js.map +0 -1
  196. package/dist/framework/range-util.d.ts +0 -40
  197. package/dist/framework/range-util.js +0 -312
  198. package/dist/framework/range-util.js.map +0 -1
  199. package/dist/framework/render-context.d.ts +0 -91
  200. package/dist/framework/render-context.js +0 -384
  201. package/dist/framework/render-context.js.map +0 -1
  202. package/dist/framework/render-define.d.ts +0 -109
  203. package/dist/framework/render-define.js +0 -195
  204. package/dist/framework/render-define.js.map +0 -1
  205. package/dist/framework/selection-overlays.d.ts +0 -30
  206. package/dist/framework/selection-overlays.js +0 -124
  207. package/dist/framework/selection-overlays.js.map +0 -1
  208. package/dist/texteditor.d.ts +0 -318
  209. package/dist/texteditor.js +0 -913
  210. package/dist/texteditor.js.map +0 -1
  211. package/dist/util/subject.d.ts +0 -34
  212. package/dist/util/subject.js +0 -88
  213. package/dist/util/subject.js.map +0 -1
  214. package/dist/util/table-bind.d.ts +0 -5
  215. package/dist/util/table-bind.js +0 -6
  216. package/dist/util/table-bind.js.map +0 -1
@@ -1,809 +0,0 @@
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