@hailin-zheng/editor-core 1.0.18 → 1.0.20

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 (291) hide show
  1. package/lib/doc-ruler.d.ts +1 -0
  2. package/lib/doc-ruler.d.ts.map +1 -0
  3. package/lib/framework/common-util.d.ts +1 -0
  4. package/lib/framework/common-util.d.ts.map +1 -0
  5. package/lib/framework/document-change.d.ts +1 -0
  6. package/lib/framework/document-change.d.ts.map +1 -0
  7. package/lib/framework/document-combine.d.ts +1 -0
  8. package/lib/framework/document-combine.d.ts.map +1 -0
  9. package/lib/framework/document-comment.d.ts +1 -0
  10. package/lib/framework/document-comment.d.ts.map +1 -0
  11. package/lib/framework/document-context.d.ts +1 -0
  12. package/lib/framework/document-context.d.ts.map +1 -0
  13. package/lib/framework/document-eval-func.d.ts +1 -0
  14. package/lib/framework/document-eval-func.d.ts.map +1 -0
  15. package/lib/framework/document-event.d.ts +1 -0
  16. package/lib/framework/document-event.d.ts.map +1 -0
  17. package/lib/framework/document-history.d.ts +1 -0
  18. package/lib/framework/document-history.d.ts.map +1 -0
  19. package/lib/framework/document-images-loader.d.ts +1 -0
  20. package/lib/framework/document-images-loader.d.ts.map +1 -0
  21. package/lib/framework/document-input-cursor.d.ts +1 -0
  22. package/lib/framework/document-input-cursor.d.ts.map +1 -0
  23. package/lib/framework/document-paint.d.ts +1 -0
  24. package/lib/framework/document-paint.d.ts.map +1 -0
  25. package/lib/framework/document-print-offscreen.d.ts +1 -0
  26. package/lib/framework/document-print-offscreen.d.ts.map +1 -0
  27. package/lib/framework/document-print.d.ts +1 -0
  28. package/lib/framework/document-print.d.ts.map +1 -0
  29. package/lib/framework/document-segmenter.d.ts +1 -0
  30. package/lib/framework/document-segmenter.d.ts.map +1 -0
  31. package/lib/framework/document-selection.d.ts +1 -0
  32. package/lib/framework/document-selection.d.ts.map +1 -0
  33. package/lib/framework/document-template.d.ts +1 -0
  34. package/lib/framework/document-template.d.ts.map +1 -0
  35. package/lib/framework/document-textline-mode.d.ts +1 -0
  36. package/lib/framework/document-textline-mode.d.ts.map +1 -0
  37. package/lib/framework/element-define.d.ts +1 -0
  38. package/lib/framework/element-define.d.ts.map +1 -0
  39. package/lib/framework/element-event-define.d.ts +1 -0
  40. package/lib/framework/element-event-define.d.ts.map +1 -0
  41. package/lib/framework/element-measure.d.ts +1 -0
  42. package/lib/framework/element-measure.d.ts.map +1 -0
  43. package/lib/framework/element-paint.d.ts +1 -0
  44. package/lib/framework/element-paint.d.ts.map +1 -0
  45. package/lib/framework/element-props.d.ts +2 -1
  46. package/lib/framework/element-props.d.ts.map +1 -0
  47. package/lib/framework/element-reader.d.ts +1 -0
  48. package/lib/framework/element-reader.d.ts.map +1 -0
  49. package/lib/framework/element-render-cut.d.ts +1 -0
  50. package/lib/framework/element-render-cut.d.ts.map +1 -0
  51. package/lib/framework/element-serialize.d.ts +1 -0
  52. package/lib/framework/element-serialize.d.ts.map +1 -0
  53. package/lib/framework/element-util.d.ts +1 -0
  54. package/lib/framework/element-util.d.ts.map +1 -0
  55. package/lib/framework/impl/checkbox/checkbox-impl.d.ts +1 -0
  56. package/lib/framework/impl/checkbox/checkbox-impl.d.ts.map +1 -0
  57. package/lib/framework/impl/comments/comment-content-impl.d.ts +1 -0
  58. package/lib/framework/impl/comments/comment-content-impl.d.ts.map +1 -0
  59. package/lib/framework/impl/comments/comment-element-impl.d.ts +1 -0
  60. package/lib/framework/impl/comments/comment-element-impl.d.ts.map +1 -0
  61. package/lib/framework/impl/comments/comments-container-impl.d.ts +1 -0
  62. package/lib/framework/impl/comments/comments-container-impl.d.ts.map +1 -0
  63. package/lib/framework/impl/comments/comments-util.d.ts +1 -0
  64. package/lib/framework/impl/comments/comments-util.d.ts.map +1 -0
  65. package/lib/framework/impl/comments/validate-msg-impl.d.ts +1 -0
  66. package/lib/framework/impl/comments/validate-msg-impl.d.ts.map +1 -0
  67. package/lib/framework/impl/data-element/data-decorate-impl.d.ts +1 -0
  68. package/lib/framework/impl/data-element/data-decorate-impl.d.ts.map +1 -0
  69. package/lib/framework/impl/data-element/data-element-barcode.d.ts +1 -0
  70. package/lib/framework/impl/data-element/data-element-barcode.d.ts.map +1 -0
  71. package/lib/framework/impl/data-element/data-element-base-impl.d.ts +1 -0
  72. package/lib/framework/impl/data-element/data-element-base-impl.d.ts.map +1 -0
  73. package/lib/framework/impl/data-element/data-element-check-impl.d.ts +1 -0
  74. package/lib/framework/impl/data-element/data-element-check-impl.d.ts.map +1 -0
  75. package/lib/framework/impl/data-element/data-element-date-impl.d.ts +1 -0
  76. package/lib/framework/impl/data-element/data-element-date-impl.d.ts.map +1 -0
  77. package/lib/framework/impl/data-element/data-element-group-impl.d.ts +1 -0
  78. package/lib/framework/impl/data-element/data-element-group-impl.d.ts.map +1 -0
  79. package/lib/framework/impl/data-element/data-element-image-impl.d.ts +1 -0
  80. package/lib/framework/impl/data-element/data-element-image-impl.d.ts.map +1 -0
  81. package/lib/framework/impl/data-element/data-element-list-impl.d.ts +1 -0
  82. package/lib/framework/impl/data-element/data-element-list-impl.d.ts.map +1 -0
  83. package/lib/framework/impl/data-element/data-element-text-impl.d.ts +1 -0
  84. package/lib/framework/impl/data-element/data-element-text-impl.d.ts.map +1 -0
  85. package/lib/framework/impl/decorate/fill-null-space-imple.d.ts +1 -0
  86. package/lib/framework/impl/decorate/fill-null-space-imple.d.ts.map +1 -0
  87. package/lib/framework/impl/document/doc-body-impl.d.ts +1 -0
  88. package/lib/framework/impl/document/doc-body-impl.d.ts.map +1 -0
  89. package/lib/framework/impl/document/doc-body-part-impl.d.ts +1 -0
  90. package/lib/framework/impl/document/doc-body-part-impl.d.ts.map +1 -0
  91. package/lib/framework/impl/document/doc-container-impl.d.ts +1 -0
  92. package/lib/framework/impl/document/doc-container-impl.d.ts.map +1 -0
  93. package/lib/framework/impl/document/doc-footer-impl.d.ts +1 -0
  94. package/lib/framework/impl/document/doc-footer-impl.d.ts.map +1 -0
  95. package/lib/framework/impl/document/doc-header-impl.d.ts +1 -0
  96. package/lib/framework/impl/document/doc-header-impl.d.ts.map +1 -0
  97. package/lib/framework/impl/document/doc-impl.d.ts +1 -0
  98. package/lib/framework/impl/document/doc-impl.d.ts.map +1 -0
  99. package/lib/framework/impl/index.d.ts +37 -0
  100. package/lib/framework/impl/index.d.ts.map +1 -0
  101. package/lib/framework/impl/media-formula/menstrual-history.d.ts +1 -0
  102. package/lib/framework/impl/media-formula/menstrual-history.d.ts.map +1 -0
  103. package/lib/framework/impl/paragraph/p-impl.d.ts +1 -0
  104. package/lib/framework/impl/paragraph/p-impl.d.ts.map +1 -0
  105. package/lib/framework/impl/picture/image-impl.d.ts +1 -0
  106. package/lib/framework/impl/picture/image-impl.d.ts.map +1 -0
  107. package/lib/framework/impl/radio/radio-impl.d.ts +1 -0
  108. package/lib/framework/impl/radio/radio-impl.d.ts.map +1 -0
  109. package/lib/framework/impl/symbol/br-symbol-impl.d.ts +1 -0
  110. package/lib/framework/impl/symbol/br-symbol-impl.d.ts.map +1 -0
  111. package/lib/framework/impl/symbol/p-symbol-impl.d.ts +1 -0
  112. package/lib/framework/impl/symbol/p-symbol-impl.d.ts.map +1 -0
  113. package/lib/framework/impl/table/table-cell-impl.d.ts +1 -0
  114. package/lib/framework/impl/table/table-cell-impl.d.ts.map +1 -0
  115. package/lib/framework/impl/table/table-impl.d.ts +1 -0
  116. package/lib/framework/impl/table/table-impl.d.ts.map +1 -0
  117. package/lib/framework/impl/table/table-row-impl.d.ts +1 -0
  118. package/lib/framework/impl/table/table-row-impl.d.ts.map +1 -0
  119. package/lib/framework/impl/table/table-split-cell-patch.d.ts +1 -0
  120. package/lib/framework/impl/table/table-split-cell-patch.d.ts.map +1 -0
  121. package/lib/framework/impl/table/table-split-cell.d.ts +1 -0
  122. package/lib/framework/impl/table/table-split-cell.d.ts.map +1 -0
  123. package/lib/framework/impl/table/table-util.d.ts +1 -0
  124. package/lib/framework/impl/table/table-util.d.ts.map +1 -0
  125. package/lib/framework/impl/text/text-impl.d.ts +1 -0
  126. package/lib/framework/impl/text/text-impl.d.ts.map +1 -0
  127. package/lib/framework/impl/text/track-run-impl.d.ts +1 -0
  128. package/lib/framework/impl/text/track-run-impl.d.ts.map +1 -0
  129. package/lib/framework/notify.d.ts +1 -0
  130. package/lib/framework/notify.d.ts.map +1 -0
  131. package/lib/framework/range-util.d.ts +1 -0
  132. package/lib/framework/range-util.d.ts.map +1 -0
  133. package/lib/framework/render-context.d.ts +1 -0
  134. package/lib/framework/render-context.d.ts.map +1 -0
  135. package/lib/framework/render-define.d.ts +1 -0
  136. package/lib/framework/render-define.d.ts.map +1 -0
  137. package/lib/framework/selection-overlays.d.ts +1 -0
  138. package/lib/framework/selection-overlays.d.ts.map +1 -0
  139. package/lib/index.d.ts +35 -0
  140. package/lib/index.d.ts.map +1 -0
  141. package/lib/index.js +15671 -0
  142. package/lib/texteditor.d.ts +3 -2
  143. package/lib/texteditor.d.ts.map +1 -0
  144. package/lib/util/subject.d.ts +1 -0
  145. package/lib/util/subject.d.ts.map +1 -0
  146. package/lib/util/table-bind.d.ts +1 -0
  147. package/lib/util/table-bind.d.ts.map +1 -0
  148. package/package.json +32 -23
  149. package/README.md +0 -1613
  150. package/lib/doc-ruler.js +0 -313
  151. package/lib/doc-ruler.js.map +0 -1
  152. package/lib/framework/common-util.js +0 -178
  153. package/lib/framework/common-util.js.map +0 -1
  154. package/lib/framework/document-change.js +0 -1342
  155. package/lib/framework/document-change.js.map +0 -1
  156. package/lib/framework/document-combine.js +0 -40
  157. package/lib/framework/document-combine.js.map +0 -1
  158. package/lib/framework/document-comment.js +0 -148
  159. package/lib/framework/document-comment.js.map +0 -1
  160. package/lib/framework/document-context.js +0 -330
  161. package/lib/framework/document-context.js.map +0 -1
  162. package/lib/framework/document-eval-func.js +0 -48
  163. package/lib/framework/document-eval-func.js.map +0 -1
  164. package/lib/framework/document-event.js +0 -1054
  165. package/lib/framework/document-event.js.map +0 -1
  166. package/lib/framework/document-history.js +0 -65
  167. package/lib/framework/document-history.js.map +0 -1
  168. package/lib/framework/document-images-loader.js +0 -66
  169. package/lib/framework/document-images-loader.js.map +0 -1
  170. package/lib/framework/document-input-cursor.js +0 -239
  171. package/lib/framework/document-input-cursor.js.map +0 -1
  172. package/lib/framework/document-paint.js +0 -103
  173. package/lib/framework/document-paint.js.map +0 -1
  174. package/lib/framework/document-print-offscreen.js +0 -128
  175. package/lib/framework/document-print-offscreen.js.map +0 -1
  176. package/lib/framework/document-print.js +0 -203
  177. package/lib/framework/document-print.js.map +0 -1
  178. package/lib/framework/document-segmenter.js +0 -106
  179. package/lib/framework/document-segmenter.js.map +0 -1
  180. package/lib/framework/document-selection.js +0 -358
  181. package/lib/framework/document-selection.js.map +0 -1
  182. package/lib/framework/document-template.js +0 -20
  183. package/lib/framework/document-template.js.map +0 -1
  184. package/lib/framework/document-textline-mode.js +0 -30
  185. package/lib/framework/document-textline-mode.js.map +0 -1
  186. package/lib/framework/element-define.js +0 -579
  187. package/lib/framework/element-define.js.map +0 -1
  188. package/lib/framework/element-event-define.js +0 -108
  189. package/lib/framework/element-event-define.js.map +0 -1
  190. package/lib/framework/element-measure.js +0 -551
  191. package/lib/framework/element-measure.js.map +0 -1
  192. package/lib/framework/element-paint.js +0 -170
  193. package/lib/framework/element-paint.js.map +0 -1
  194. package/lib/framework/element-props.js +0 -809
  195. package/lib/framework/element-props.js.map +0 -1
  196. package/lib/framework/element-reader.js +0 -151
  197. package/lib/framework/element-reader.js.map +0 -1
  198. package/lib/framework/element-render-cut.js +0 -449
  199. package/lib/framework/element-render-cut.js.map +0 -1
  200. package/lib/framework/element-serialize.js +0 -113
  201. package/lib/framework/element-serialize.js.map +0 -1
  202. package/lib/framework/element-util.js +0 -1463
  203. package/lib/framework/element-util.js.map +0 -1
  204. package/lib/framework/impl/checkbox/checkbox-impl.js +0 -64
  205. package/lib/framework/impl/checkbox/checkbox-impl.js.map +0 -1
  206. package/lib/framework/impl/comments/comment-content-impl.js +0 -105
  207. package/lib/framework/impl/comments/comment-content-impl.js.map +0 -1
  208. package/lib/framework/impl/comments/comment-element-impl.js +0 -62
  209. package/lib/framework/impl/comments/comment-element-impl.js.map +0 -1
  210. package/lib/framework/impl/comments/comments-container-impl.js +0 -62
  211. package/lib/framework/impl/comments/comments-container-impl.js.map +0 -1
  212. package/lib/framework/impl/comments/comments-util.js +0 -67
  213. package/lib/framework/impl/comments/comments-util.js.map +0 -1
  214. package/lib/framework/impl/comments/validate-msg-impl.js +0 -83
  215. package/lib/framework/impl/comments/validate-msg-impl.js.map +0 -1
  216. package/lib/framework/impl/data-element/data-decorate-impl.js +0 -91
  217. package/lib/framework/impl/data-element/data-decorate-impl.js.map +0 -1
  218. package/lib/framework/impl/data-element/data-element-barcode.js +0 -115
  219. package/lib/framework/impl/data-element/data-element-barcode.js.map +0 -1
  220. package/lib/framework/impl/data-element/data-element-base-impl.js +0 -205
  221. package/lib/framework/impl/data-element/data-element-base-impl.js.map +0 -1
  222. package/lib/framework/impl/data-element/data-element-check-impl.js +0 -133
  223. package/lib/framework/impl/data-element/data-element-check-impl.js.map +0 -1
  224. package/lib/framework/impl/data-element/data-element-date-impl.js +0 -111
  225. package/lib/framework/impl/data-element/data-element-date-impl.js.map +0 -1
  226. package/lib/framework/impl/data-element/data-element-group-impl.js +0 -130
  227. package/lib/framework/impl/data-element/data-element-group-impl.js.map +0 -1
  228. package/lib/framework/impl/data-element/data-element-image-impl.js +0 -137
  229. package/lib/framework/impl/data-element/data-element-image-impl.js.map +0 -1
  230. package/lib/framework/impl/data-element/data-element-list-impl.js +0 -131
  231. package/lib/framework/impl/data-element/data-element-list-impl.js.map +0 -1
  232. package/lib/framework/impl/data-element/data-element-text-impl.js +0 -103
  233. package/lib/framework/impl/data-element/data-element-text-impl.js.map +0 -1
  234. package/lib/framework/impl/decorate/fill-null-space-imple.js +0 -43
  235. package/lib/framework/impl/decorate/fill-null-space-imple.js.map +0 -1
  236. package/lib/framework/impl/document/doc-body-impl.js +0 -79
  237. package/lib/framework/impl/document/doc-body-impl.js.map +0 -1
  238. package/lib/framework/impl/document/doc-body-part-impl.js +0 -94
  239. package/lib/framework/impl/document/doc-body-part-impl.js.map +0 -1
  240. package/lib/framework/impl/document/doc-container-impl.js +0 -21
  241. package/lib/framework/impl/document/doc-container-impl.js.map +0 -1
  242. package/lib/framework/impl/document/doc-footer-impl.js +0 -77
  243. package/lib/framework/impl/document/doc-footer-impl.js.map +0 -1
  244. package/lib/framework/impl/document/doc-header-impl.js +0 -83
  245. package/lib/framework/impl/document/doc-header-impl.js.map +0 -1
  246. package/lib/framework/impl/document/doc-impl.js +0 -209
  247. package/lib/framework/impl/document/doc-impl.js.map +0 -1
  248. package/lib/framework/impl/media-formula/menstrual-history.js +0 -153
  249. package/lib/framework/impl/media-formula/menstrual-history.js.map +0 -1
  250. package/lib/framework/impl/paragraph/p-impl.js +0 -156
  251. package/lib/framework/impl/paragraph/p-impl.js.map +0 -1
  252. package/lib/framework/impl/picture/image-impl.js +0 -124
  253. package/lib/framework/impl/picture/image-impl.js.map +0 -1
  254. package/lib/framework/impl/radio/radio-impl.js +0 -72
  255. package/lib/framework/impl/radio/radio-impl.js.map +0 -1
  256. package/lib/framework/impl/symbol/br-symbol-impl.js +0 -54
  257. package/lib/framework/impl/symbol/br-symbol-impl.js.map +0 -1
  258. package/lib/framework/impl/symbol/p-symbol-impl.js +0 -54
  259. package/lib/framework/impl/symbol/p-symbol-impl.js.map +0 -1
  260. package/lib/framework/impl/table/table-cell-impl.js +0 -145
  261. package/lib/framework/impl/table/table-cell-impl.js.map +0 -1
  262. package/lib/framework/impl/table/table-impl.js +0 -363
  263. package/lib/framework/impl/table/table-impl.js.map +0 -1
  264. package/lib/framework/impl/table/table-row-impl.js +0 -75
  265. package/lib/framework/impl/table/table-row-impl.js.map +0 -1
  266. package/lib/framework/impl/table/table-split-cell-patch.js +0 -89
  267. package/lib/framework/impl/table/table-split-cell-patch.js.map +0 -1
  268. package/lib/framework/impl/table/table-split-cell.js +0 -464
  269. package/lib/framework/impl/table/table-split-cell.js.map +0 -1
  270. package/lib/framework/impl/table/table-util.js +0 -678
  271. package/lib/framework/impl/table/table-util.js.map +0 -1
  272. package/lib/framework/impl/text/text-impl.js +0 -149
  273. package/lib/framework/impl/text/text-impl.js.map +0 -1
  274. package/lib/framework/impl/text/track-run-impl.js +0 -112
  275. package/lib/framework/impl/text/track-run-impl.js.map +0 -1
  276. package/lib/framework/notify.js +0 -116
  277. package/lib/framework/notify.js.map +0 -1
  278. package/lib/framework/range-util.js +0 -312
  279. package/lib/framework/range-util.js.map +0 -1
  280. package/lib/framework/render-context.js +0 -384
  281. package/lib/framework/render-context.js.map +0 -1
  282. package/lib/framework/render-define.js +0 -195
  283. package/lib/framework/render-define.js.map +0 -1
  284. package/lib/framework/selection-overlays.js +0 -124
  285. package/lib/framework/selection-overlays.js.map +0 -1
  286. package/lib/texteditor.js +0 -913
  287. package/lib/texteditor.js.map +0 -1
  288. package/lib/util/subject.js +0 -88
  289. package/lib/util/subject.js.map +0 -1
  290. package/lib/util/table-bind.js +0 -6
  291. package/lib/util/table-bind.js.map +0 -1
@@ -1,131 +0,0 @@
1
- import { ElementFactory } from "../../element-define";
2
- import { DataEleListProps } from "../../element-props";
3
- import { ElementUtil } from "../../element-util";
4
- import { ElementSerialize } from "../../element-serialize";
5
- import { TextGroupElement } from "../text/text-impl";
6
- import { DataElementInlineGroup, DataElementRenderObject } from "./data-element-base-impl";
7
- export class DataElementList extends DataElementInlineGroup {
8
- //props: DataEleListProps;
9
- constructor() {
10
- super('data-ele-list');
11
- this.props = new DataEleListProps();
12
- }
13
- createRenderObject() {
14
- return new DataElementListRenderObject(this);
15
- }
16
- serialize(viewOptions) {
17
- return {
18
- type: this.type,
19
- props: {
20
- ...this.props.getSerializeProps(viewOptions)
21
- }
22
- };
23
- }
24
- clone(data) {
25
- const clone = new DataElementList();
26
- this.props.clone(clone.props);
27
- if (data) {
28
- const length = this.length;
29
- for (let i = 0; i < length; i++) {
30
- const child = this.getChild(i);
31
- if (child !== this.startDecorate && child !== this.endDecorate) {
32
- clone.addChild(child.clone(true));
33
- }
34
- }
35
- }
36
- return clone;
37
- }
38
- setValue(vals) {
39
- if (this.getValue() === vals.join(';')) {
40
- return;
41
- }
42
- this.pubOnChange('self');
43
- this.clearInnerItems();
44
- if (this.props.multiSelect) {
45
- for (let i = 0; i < vals.length; i++) {
46
- const val = vals[i];
47
- const option = this.props.options.find(item => item.code === val);
48
- if (option) {
49
- const valueText = new TextGroupElement();
50
- this.props.valueTextProps.clone(valueText.props);
51
- const splitSymbol = i < vals.length - 1 ? ';' : '';
52
- valueText.text = option.value + splitSymbol;
53
- this.addChild(valueText, this.length - 1);
54
- }
55
- }
56
- }
57
- else {
58
- if (vals.length > 1) {
59
- console.warn('当前下拉框是单选模式,不能传入多个值');
60
- }
61
- const val = vals[0];
62
- const option = this.props.options.find(item => item.code === val);
63
- if (option) {
64
- const valueText = new TextGroupElement();
65
- this.props.valueTextProps.clone(valueText.props);
66
- valueText.text = option.value;
67
- this.addChild(valueText, this.length - 1);
68
- }
69
- }
70
- this.beginMeasure();
71
- }
72
- getValue() {
73
- const values = ElementSerialize.serializeString(this);
74
- if (!values) {
75
- return '';
76
- }
77
- const valueItems = values.split(';');
78
- const valueCode = [];
79
- for (const valueItem of valueItems) {
80
- const option = this.props.options.find(item => item.value === valueItem);
81
- if (option) {
82
- valueCode.push(option.code);
83
- }
84
- else {
85
- valueCode.push(option + '');
86
- }
87
- }
88
- return valueCode.join(';');
89
- }
90
- }
91
- export class DataElementListRenderObject extends DataElementRenderObject {
92
- constructor(element) {
93
- super(element);
94
- }
95
- clone() {
96
- const cloneRender = new DataElementListRenderObject(this.element);
97
- cloneRender.rect = ElementUtil.cloneRect(this.rect);
98
- for (let i = 0; i < this.length; i++) {
99
- cloneRender.addChild(this.getChild(i).clone());
100
- }
101
- return cloneRender;
102
- }
103
- }
104
- export class DataElementListFactory extends ElementFactory {
105
- match(type) {
106
- return type === "data-ele-list";
107
- }
108
- createElement(data, renderCtx) {
109
- const props = data.props;
110
- const ele = new DataElementList();
111
- this.createDataEleProps(ele.props, props);
112
- return ele;
113
- }
114
- createDataEleProps(dest, props) {
115
- const dataEleProps = dest;
116
- ElementUtil.readEleBaseProps(dataEleProps, props);
117
- //dataEleProps.id = props.id ?? nanoid(5);
118
- //dataEleProps.name = props.name;
119
- //dataEleProps.caption = props.caption;
120
- //dataEleProps.type = props.type;
121
- dataEleProps.nullText = props.nullText;
122
- dataEleProps.nullTextProps = ElementUtil.readTextProps(null, props.nullTextProps, this.options);
123
- dataEleProps.valueTextProps = ElementUtil.readTextProps(null, props.valueTextProps, this.options);
124
- const options = props.options || [];
125
- dataEleProps.multiSelect = props.multiSelect;
126
- dataEleProps.options = [...options];
127
- dataEleProps.dropDownStyle = props.dropDownStyle;
128
- return dataEleProps;
129
- }
130
- }
131
- //# sourceMappingURL=data-element-list-impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-element-list-impl.js","sourceRoot":"lib/","sources":["framework/impl/data-element/data-element-list-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAAiD,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,gBAAgB,EAAwB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAE3F,MAAM,OAAO,eAAgB,SAAQ,sBAAwC;IACzE,0BAA0B;IAC1B;QACI,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,gBAAgB,EAAE,CAAC;IACxC,CAAC;IAED,kBAAkB;QACd,OAAO,IAAI,2BAA2B,CAAC,IAAI,CAAC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,KAAK,CAAC,IAAY;QACd,OAAO,IAAI,KAAK,eAAe,CAAA;IACnC,CAAC;IACD,aAAa,CAAC,IAAwC,EAAE,SAA6B;QACjF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAyB,CAAC;QAC7C,MAAM,GAAG,GAAG,IAAI,eAAe,EAAE,CAAC;QAClC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1C,OAAO,GAAG,CAAC;IACf,CAAC;IAED,kBAAkB,CAAC,IAAsB,EAAE,KAAuB;QAC9D,MAAM,YAAY,GAAqB,IAAI,CAAC;QAC5C,WAAW,CAAC,gBAAgB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAClD,0CAA0C;QAC1C,iCAAiC;QACjC,uCAAuC;QACvC,iCAAiC;QACjC,YAAY,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QACvC,YAAY,CAAC,aAAa,GAAG,WAAW,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChG,YAAY,CAAC,cAAc,GAAG,WAAW,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAClG,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;QACpC,YAAY,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAC7C,YAAY,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;QACpC,YAAY,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QACjD,OAAO,YAAY,CAAC;IACxB,CAAC;CAEJ","sourcesContent":["import { Element, ElementFactory, readElementProps, SerializeProps, ViewOptions } from \"../../element-define\";\nimport { DataEleListProps, DataEleBaseTextProps } from \"../../element-props\";\nimport { ElementUtil } from \"../../element-util\";\nimport { RenderContenxtType } from \"../../render-context\";\nimport { RenderObject } from \"../../render-define\";\nimport { ElementSerialize } from \"../../element-serialize\";\nimport { TextGroupElement } from \"../text/text-impl\";\nimport { DataElementInlineGroup, DataElementRenderObject } from \"./data-element-base-impl\";\n\nexport class DataElementList extends DataElementInlineGroup<DataEleListProps> {\n //props: DataEleListProps;\n constructor() {\n super('data-ele-list');\n this.props = new DataEleListProps();\n }\n\n createRenderObject(): RenderObject {\n return new DataElementListRenderObject(this);\n }\n\n serialize(viewOptions: ViewOptions): SerializeProps & any {\n return {\n type: this.type,\n props: {\n ...this.props.getSerializeProps(viewOptions)\n }\n }\n }\n\n clone(data: boolean): DataElementList {\n const clone = new DataElementList();\n this.props.clone(clone.props);\n if (data) {\n const length = this.length;\n for (let i = 0; i < length; i++) {\n const child = this.getChild(i);\n if (child !== this.startDecorate && child !== this.endDecorate) {\n clone.addChild(child.clone(true));\n }\n }\n }\n return clone;\n }\n\n setValue(vals: string[]): void {\n if (this.getValue() === vals.join(';')) {\n return;\n }\n this.pubOnChange('self');\n this.clearInnerItems();\n if (this.props.multiSelect) {\n for (let i = 0; i < vals.length; i++) {\n const val = vals[i];\n const option = this.props.options.find(item => item.code === val);\n if (option) {\n const valueText = new TextGroupElement();\n this.props.valueTextProps.clone(valueText.props);\n const splitSymbol = i < vals.length - 1 ? ';' : ''\n valueText.text = option.value + splitSymbol;\n this.addChild(valueText, this.length - 1);\n }\n }\n } else {\n if (vals.length > 1) {\n console.warn('当前下拉框是单选模式,不能传入多个值')\n }\n const val = vals[0];\n const option = this.props.options.find(item => item.code === val);\n if (option) {\n const valueText = new TextGroupElement();\n this.props.valueTextProps.clone(valueText.props);\n valueText.text = option.value;\n this.addChild(valueText, this.length - 1);\n }\n }\n this.beginMeasure();\n }\n\n getValue(): string {\n const values = ElementSerialize.serializeString(this);\n if (!values) {\n return '';\n }\n const valueItems = values.split(';');\n const valueCode: Array<string> = [];\n for (const valueItem of valueItems) {\n const option = this.props.options.find(item => item.value === valueItem);\n if (option) {\n valueCode.push(option.code)\n } else {\n valueCode.push(option + '')\n }\n }\n return valueCode.join(';')\n }\n}\n\n\nexport class DataElementListRenderObject extends DataElementRenderObject<DataElementList> {\n constructor(element: DataElementList) {\n super(element);\n }\n clone(): RenderObject {\n const cloneRender = new DataElementListRenderObject(this.element);\n cloneRender.rect = ElementUtil.cloneRect(this.rect);\n for (let i = 0; i < this.length; i++) {\n cloneRender.addChild(this.getChild(i).clone());\n }\n return cloneRender;\n }\n\n}\n\nexport class DataElementListFactory extends ElementFactory<DataEleListProps> {\n match(type: string): boolean {\n return type === \"data-ele-list\"\n }\n createElement(data: readElementProps<DataEleListProps>, renderCtx: RenderContenxtType): Element {\n const props = data.props as DataEleListProps;\n const ele = new DataElementList();\n this.createDataEleProps(ele.props, props);\n return ele;\n }\n\n createDataEleProps(dest: DataEleListProps, props: DataEleListProps): DataEleBaseTextProps {\n const dataEleProps: DataEleListProps = dest;\n ElementUtil.readEleBaseProps(dataEleProps, props);\n //dataEleProps.id = props.id ?? nanoid(5);\n //dataEleProps.name = props.name;\n //dataEleProps.caption = props.caption;\n //dataEleProps.type = props.type;\n dataEleProps.nullText = props.nullText;\n dataEleProps.nullTextProps = ElementUtil.readTextProps(null, props.nullTextProps, this.options);\n dataEleProps.valueTextProps = ElementUtil.readTextProps(null, props.valueTextProps, this.options);\n const options = props.options || [];\n dataEleProps.multiSelect = props.multiSelect;\n dataEleProps.options = [...options];\n dataEleProps.dropDownStyle = props.dropDownStyle;\n return dataEleProps;\n }\n\n}\n"]}
@@ -1,103 +0,0 @@
1
- import { ElementFactory } from "../../element-define";
2
- import { DataEleBaseTextProps } from "../../element-props";
3
- import { ElementUtil } from "../../element-util";
4
- import { ElementSerialize } from "../../element-serialize";
5
- import { TextGroupElement } from "../text/text-impl";
6
- import { DataElementInlineGroup, DataElementRenderObject } from "./data-element-base-impl";
7
- export class DataElementText extends DataElementInlineGroup {
8
- //props: DataEleBaseTextProps;
9
- constructor() {
10
- super('data-ele-text');
11
- this.props = new DataEleBaseTextProps();
12
- }
13
- createRenderObject() {
14
- return new DataElementTextRenderObject(this);
15
- }
16
- serialize(viewOptions) {
17
- return {
18
- type: this.type,
19
- props: {
20
- ...this.props.getSerializeProps(viewOptions)
21
- }
22
- };
23
- }
24
- clone(data) {
25
- const clone = new DataElementText();
26
- this.props.clone(clone.props);
27
- if (data) {
28
- const length = this.length;
29
- for (let i = 0; i < length; i++) {
30
- const child = this.getChild(i);
31
- if (child !== this.startDecorate && child !== this.endDecorate) {
32
- clone.addChild(child.clone(true));
33
- }
34
- }
35
- }
36
- return clone;
37
- }
38
- setValue(val) {
39
- if (!this.startDecorate) {
40
- return;
41
- }
42
- if (this.getValue() === val) {
43
- return;
44
- }
45
- this.pubOnChange('self');
46
- this.clearInnerItems();
47
- if (val) {
48
- const valueText = new TextGroupElement();
49
- this.props.valueTextProps.clone(valueText.props);
50
- valueText.text = val;
51
- this.addChild(valueText, this.length - 1);
52
- }
53
- this.beginMeasure();
54
- }
55
- getValue() {
56
- return ElementSerialize.serializeString(this, { all: false });
57
- }
58
- validate() {
59
- let error = super.validate();
60
- if (error) {
61
- return error;
62
- }
63
- return '';
64
- }
65
- }
66
- export class DataElementTextRenderObject extends DataElementRenderObject {
67
- constructor(element) {
68
- super(element);
69
- }
70
- clone() {
71
- const cloneRender = new DataElementTextRenderObject(this.element);
72
- cloneRender.rect = ElementUtil.cloneRect(this.rect);
73
- for (let i = 0; i < this.length; i++) {
74
- cloneRender.addChild(this.getChild(i).clone());
75
- }
76
- return cloneRender;
77
- }
78
- }
79
- export class DataElementTextFactory extends ElementFactory {
80
- match(type) {
81
- return type === "data-ele-text";
82
- }
83
- createElement(data, renderCtx) {
84
- const props = data.props;
85
- const ele = new DataElementText();
86
- this.createDataEleProps(ele.props, props);
87
- return ele;
88
- }
89
- createDataEleProps(dest, props) {
90
- const dataEleProps = dest;
91
- ElementUtil.readEleBaseProps(dataEleProps, props);
92
- //dataEleProps.id = props.id ?? nanoid(5);
93
- //dataEleProps.name = props.name;
94
- //dataEleProps.caption = props.caption;
95
- //dataEleProps.type = props.type;
96
- dataEleProps.nullText = props.nullText;
97
- dataEleProps.nullTextProps = ElementUtil.readTextProps(null, props.nullTextProps, this.options);
98
- dataEleProps.valueTextProps = ElementUtil.readTextProps(null, props.valueTextProps, this.options);
99
- dataEleProps.dataType = props.dataType;
100
- return dataEleProps;
101
- }
102
- }
103
- //# sourceMappingURL=data-element-text-impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-element-text-impl.js","sourceRoot":"lib/","sources":["framework/impl/data-element/data-element-text-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAA+B,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAE3F,MAAM,OAAO,eAAgB,SAAQ,sBAA4C;IAC7E,8BAA8B;IAC9B;QACI,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC5C,CAAC;IAED,kBAAkB;QACd,OAAO,IAAI,2BAA2B,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,SAAS,CAAC,WAAwB;QAC9B,OAAO;YACH,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE;gBACH,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC;aAC/C;SACJ,CAAA;IACL,CAAC;IAED,KAAK,CAAC,IAAa;QACf,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,CAAC,K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KAAK,CAAC,QAAQ,CAAC;QACvC,YAAY,CAAC,aAAa,GAAG,WAAW,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChG,YAAY,CAAC,cAAc,GAAG,WAAW,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAClG,YAAY,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QACvC,OAAO,YAAY,CAAC;IACxB,CAAC;CAEJ","sourcesContent":["import { Element, ElementFactory, SerializeProps, ViewOptions } from \"../../element-define\";\nimport { DataEleBaseTextProps } from \"../../element-props\";\nimport { ElementUtil } from \"../../element-util\";\nimport { RenderContenxtType } from \"../../render-context\";\nimport { RenderObject } from \"../../render-define\";\nimport { ElementSerialize } from \"../../element-serialize\";\nimport { TextGroupElement } from \"../text/text-impl\";\nimport { DataElementInlineGroup, DataElementRenderObject } from \"./data-element-base-impl\";\n\nexport class DataElementText extends DataElementInlineGroup<DataEleBaseTextProps> {\n //props: DataEleBaseTextProps;\n constructor() {\n super('data-ele-text');\n this.props = new DataEleBaseTextProps();\n }\n\n createRenderObject(): RenderObject {\n return new DataElementTextRenderObject(this);\n }\n\n serialize(viewOptions: ViewOptions): SerializeProps & any {\n return {\n type: this.type,\n props: {\n ...this.props.getSerializeProps(viewOptions)\n }\n }\n }\n\n clone(data: boolean): DataElementText {\n const clone = new DataElementText();\n this.props.clone(clone.props);\n if (data) {\n const length = this.length;\n for (let i = 0; i < length; i++) {\n const child = this.getChild(i);\n if (child !== this.startDecorate && child !== this.endDecorate) {\n clone.addChild(child.clone(true));\n }\n }\n }\n return clone;\n }\n\n setValue(val: string): void {\n if (!this.startDecorate) {\n return;\n }\n if (this.getValue() === val) {\n return;\n }\n this.pubOnChange('self');\n this.clearInnerItems();\n if (val) {\n const valueText = new TextGroupElement();\n this.props.valueTextProps.clone(valueText.props);\n valueText.text = val;\n this.addChild(valueText, this.length - 1);\n }\n this.beginMeasure();\n }\n\n getValue(): string {\n return ElementSerialize.serializeString(this, { all: false });\n }\n\n validate(): string {\n let error = super.validate();\n if (error) {\n return error;\n }\n return '';\n\n }\n}\n\nexport class DataElementTextRenderObject extends DataElementRenderObject<DataElementText> {\n constructor(element: DataElementText) {\n super(element);\n }\n clone(): RenderObject {\n const cloneRender = new DataElementTextRenderObject(this.element);\n cloneRender.rect = ElementUtil.cloneRect(this.rect);\n for (let i = 0; i < this.length; i++) {\n cloneRender.addChild(this.getChild(i).clone());\n }\n return cloneRender;\n }\n\n}\n\nexport class DataElementTextFactory extends ElementFactory<DataEleBaseTextProps> {\n match(type: string): boolean {\n return type === \"data-ele-text\"\n }\n createElement(data: any, renderCtx: RenderContenxtType): Element {\n const props = data.props as DataEleBaseTextProps;\n const ele = new DataElementText();\n this.createDataEleProps(ele.props, props);\n return ele;\n }\n\n createDataEleProps(dest: DataEleBaseTextProps, props: DataEleBaseTextProps): DataEleBaseTextProps {\n const dataEleProps: DataEleBaseTextProps = dest;\n ElementUtil.readEleBaseProps(dataEleProps, props);\n //dataEleProps.id = props.id ?? nanoid(5);\n //dataEleProps.name = props.name;\n //dataEleProps.caption = props.caption;\n //dataEleProps.type = props.type;\n dataEleProps.nullText = props.nullText;\n dataEleProps.nullTextProps = ElementUtil.readTextProps(null, props.nullTextProps, this.options);\n dataEleProps.valueTextProps = ElementUtil.readTextProps(null, props.valueTextProps, this.options);\n dataEleProps.dataType = props.dataType;\n return dataEleProps;\n }\n\n}\n"]}
@@ -1,43 +0,0 @@
1
- import { LeafElement } from "../../element-define";
2
- import { ElementUtil } from "../../element-util";
3
- import { LeafRenderObject } from "../../render-define";
4
- /**
5
- * 当前数据元内容长度小于最小长度时,需要当前元素撑开以达到最小长度
6
- */
7
- export class FillNullSpaceElement extends LeafElement {
8
- //需要填充的长度
9
- length;
10
- constructor() {
11
- super('fill-null');
12
- this.isDecorate = true;
13
- this.disableClick = true;
14
- }
15
- createRenderObject(options, renderCtx) {
16
- return new FillNullSpaceRenderObject();
17
- }
18
- serialize(viewOptions) {
19
- throw new Error("Method not implemented.");
20
- }
21
- clone(data) {
22
- //throw new Error("Method not implemented.");
23
- return new FillNullSpaceElement();
24
- }
25
- }
26
- export class FillNullSpaceRenderObject extends LeafRenderObject {
27
- constructor() {
28
- super(null);
29
- this.disableClick = true;
30
- }
31
- render(ctx, position) {
32
- //throw new Error("Method not implemented.");
33
- if (ctx.viewOptions.showDebug) {
34
- ctx.contentContext.fillRect(position.x, position.y, this.rect.width, this.rect.height, 'red');
35
- }
36
- }
37
- clone() {
38
- const clone = new FillNullSpaceRenderObject();
39
- clone.rect = ElementUtil.cloneRect(this.rect);
40
- return clone;
41
- }
42
- }
43
- //# sourceMappingURL=fill-null-space-imple.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fill-null-space-imple.js","sourceRoot":"lib/","sources":["framework/impl/decorate/fill-null-space-imple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,WAAW,EAA+B,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,qBAAqB,CAAC;AAErE;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IACjD,SAAS;IACT,MAAM,CAAU;IAChB;QACI,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IACD,kBAAkB,CAAC,OAAoB,EAAE,SAA6B;QAClE,OAAO,IAAI,yBAAyB,EAAE,CAAC;IAC3C,CAAC;IACD,SAAS,CAAC,WAAwB;QAC9B,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IACD,KAAK,CAAC,IAAa;QACf,6CAA6C;QAC7C,OAAO,IAAI,oBAAoB,EAAE,CAAC;IACtC,CAAC;CAEJ;AAGD,MAAM,OAAO,yBAA0B,SAAQ,gBAAgB;IAC3D;QACI,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IACD,MAAM,CAAC,GAAuB,EAAE,QAAmC;QAC/D,6CAA6C;QAC7C,IAAI,GAAG,CAAC,WAAW,CAAC,SAAS,EAAE;YAC3B,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SACjG;IACL,CAAC;IACD,KAAK;QACD,MAAM,KAAK,GAAG,IAAI,yBAAyB,EAAE,CAAC;QAC9C,KAAK,CAAC,IAAI,GAAG,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,KAAK,CAAC;IACjB,CAAC;CAEJ","sourcesContent":["import { Element, LeafElement, SerializeProps, ViewOptions } from \"../../element-define\";\nimport { ElementUtil } from \"../../element-util\";\nimport { RenderContenxtType } from \"../../render-context\";\nimport { LeafRenderObject, RenderObject } from \"../../render-define\";\n\n/**\n * 当前数据元内容长度小于最小长度时,需要当前元素撑开以达到最小长度\n */\nexport class FillNullSpaceElement extends LeafElement {\n //需要填充的长度\n length!: number;\n constructor() {\n super('fill-null');\n this.isDecorate = true;\n this.disableClick = true;\n }\n createRenderObject(options: ViewOptions, renderCtx: RenderContenxtType): RenderObject {\n return new FillNullSpaceRenderObject();\n }\n serialize(viewOptions: ViewOptions): SerializeProps {\n throw new Error(\"Method not implemented.\");\n }\n clone(data: boolean): Element {\n //throw new Error(\"Method not implemented.\");\n return new FillNullSpaceElement();\n }\n\n}\n\n\nexport class FillNullSpaceRenderObject extends LeafRenderObject {\n constructor() {\n super(null);\n this.disableClick = true;\n }\n render(ctx: RenderContenxtType, position: { x: number; y: number; }): void {\n //throw new Error(\"Method not implemented.\");\n if (ctx.viewOptions.showDebug) {\n ctx.contentContext.fillRect(position.x, position.y, this.rect.width, this.rect.height, 'red');\n }\n }\n clone(): RenderObject {\n const clone = new FillNullSpaceRenderObject();\n clone.rect = ElementUtil.cloneRect(this.rect);\n return clone;\n }\n\n}"]}
@@ -1,79 +0,0 @@
1
- import { BlockContainerElement, ElementFactory } from "../../element-define";
2
- import { ElementUtil } from "../../element-util";
3
- import { MuiltBlockLineRenderObject } from "../../render-define";
4
- import { DocumentElement } from "./doc-impl";
5
- export class DocumentBodyElement extends BlockContainerElement {
6
- //当前区域内是否留痕
7
- trackChanges = false;
8
- constructor() {
9
- super('body');
10
- //this.editMode = EditMode.Free;
11
- this.addEvent('ElementDblClick', (evt) => {
12
- if (this.disableClick) {
13
- this.switchEditMode(evt);
14
- }
15
- }, true);
16
- }
17
- createRenderObject() {
18
- return new DocumentBodyRenderObject(this);
19
- }
20
- serialize() {
21
- return {
22
- type: 'body',
23
- props: {}
24
- };
25
- }
26
- switchEditMode(evt) {
27
- const docElement = ElementUtil.getParentByType(this, DocumentElement);
28
- if (docElement) {
29
- docElement.switchPageHeaderEditor(evt.selectionState, this);
30
- }
31
- return;
32
- }
33
- clone(data) {
34
- const clone = new DocumentBodyElement();
35
- if (data) {
36
- for (let i = 0; i < this.length; i++) {
37
- clone.addChild(this.getChild(i).clone(true));
38
- }
39
- }
40
- return clone;
41
- }
42
- }
43
- export class DocumentBodyRenderObject extends MuiltBlockLineRenderObject {
44
- beginRender(ctx, position) {
45
- //console.log('绘制页内容-begin');
46
- if (this.element.disableClick && ctx.drawMode === 'view') {
47
- ctx.contentContext.setGlobalAlpha(0.5);
48
- }
49
- if (ctx.viewOptions.showDebug) {
50
- ctx.overlaysContext.fillRect(position.x, position.y, this.rect.width, this.rect.height, 'rgb(177,177,177,0.4)');
51
- }
52
- }
53
- endRender(ctx, position) {
54
- //console.log('绘制页内容-end');
55
- if (this.element.disableClick && ctx.drawMode === 'view') {
56
- ctx.contentContext.setGlobalAlpha(1);
57
- }
58
- }
59
- clone(cloneData = true) {
60
- const cloneRender = new DocumentBodyRenderObject(this.element);
61
- cloneRender.rect = ElementUtil.cloneRect(this.rect);
62
- if (cloneData) {
63
- for (let i = 0; i < this.length; i++) {
64
- cloneRender.addChild(this.getChild(i).clone());
65
- }
66
- }
67
- return cloneRender;
68
- }
69
- }
70
- export class DocumentBodyFactory extends ElementFactory {
71
- match(type) {
72
- return type === 'body';
73
- }
74
- createElement(data, renderCtx) {
75
- const element = new DocumentBodyElement();
76
- return element;
77
- }
78
- }
79
- //# sourceMappingURL=doc-body-impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doc-body-impl.js","sourceRoot":"lib/","sources":["framework/impl/document/doc-body-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAW,cAAc,EAAwB,MAAM,sBAAsB,CAAC;AAE5G,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,0BAA0B,EAAgB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,MAAM,OAAO,mBAAoB,SAAQ,qBAAqB;IAC1D,WAAW;IACX,YAAY,GAAY,KAAK,CAAC;IAC9B;QACI,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,gCAAgC;QAChC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,GAAG,EAAE,EAAE;YACrC,IAAI,IAAI,CAAC,YAAY,EAAE;gBACnB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;aAC5B;QACL,CAAC,EAAE,IAAI,CAAC,CAAC;IACb,CAAC;IACD,kBAAkB;QACd,OAAO,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,SAAS;QACL,OAAO;YACH,IAAI,EAAE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AAY,IAAI,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE;YACtD,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;SACxC;IACL,CAAC;IAED,KAAK,CAAC,SAAS,GAAG,IAAI;QAClB,MAAM,WAAW,GAAG,IAAI,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/D,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,SAAS,EAAE;YACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAClC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;aAClD;SACJ;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;CAEJ;AAGD,MAAM,OAAO,mBAAoB,SAAQ,cAAoB;IACzD,KAAK,CAAC,IAAY;QACd,OAAO,IAAI,KAAK,MAAM,CAAC;IAC3B,CAAC;IACD,aAAa,CAAC,IAAS,EAAE,SAA6B;QAClD,MAAM,OAAO,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAC1C,OAAO,OAAO,CAAC;IACnB,CAAC;CAEJ","sourcesContent":["import { BlockContainerElement, Element, ElementFactory, Rect, SerializeProps } from \"../../element-define\";\nimport { MouseElementEvent } from \"../../element-event-define\";\nimport { ElementUtil } from \"../../element-util\";\nimport { RenderContenxtType } from \"../../render-context\";\nimport { MuiltBlockLineRenderObject, RenderObject } from \"../../render-define\";\nimport { DocumentElement } from \"./doc-impl\";\n\n\nexport class DocumentBodyElement extends BlockContainerElement {\n //当前区域内是否留痕\n trackChanges: boolean = false;\n constructor() {\n super('body');\n //this.editMode = EditMode.Free;\n this.addEvent('ElementDblClick', (evt) => {\n if (this.disableClick) {\n this.switchEditMode(evt);\n }\n }, true);\n }\n createRenderObject(): DocumentBodyRenderObject {\n return new DocumentBodyRenderObject(this);\n }\n\n serialize(): SerializeProps {\n return {\n type: 'body',\n props: {}\n }\n }\n\n switchEditMode(evt: MouseElementEvent): void {\n const docElement = ElementUtil.getParentByType(this, DocumentElement);\n if (docElement) {\n docElement.switchPageHeaderEditor(evt.selectionState, this);\n }\n return;\n }\n\n clone(data: boolean): DocumentBodyElement {\n const clone = new DocumentBodyElement();\n if (data) {\n for (let i = 0; i < this.length; i++) {\n clone.addChild(this.getChild(i).clone(true));\n }\n }\n return clone;\n }\n\n\n}\n\n\nexport class DocumentBodyRenderObject extends MuiltBlockLineRenderObject {\n beginRender(ctx: RenderContenxtType, position: { x: number; y: number; }): void {\n //console.log('绘制页内容-begin');\n if (this.element.disableClick && ctx.drawMode === 'view') {\n ctx.contentContext.setGlobalAlpha(0.5);\n }\n if (ctx.viewOptions.showDebug) {\n ctx.overlaysContext.fillRect(position.x, position.y, this.rect.width, this.rect.height, 'rgb(177,177,177,0.4)');\n }\n }\n endRender(ctx: RenderContenxtType, position: { x: number; y: number; }): void {\n //console.log('绘制页内容-end');\n if (this.element.disableClick && ctx.drawMode === 'view') {\n ctx.contentContext.setGlobalAlpha(1);\n }\n }\n\n clone(cloneData = true): RenderObject {\n const cloneRender = new DocumentBodyRenderObject(this.element);\n cloneRender.rect = ElementUtil.cloneRect(this.rect);\n if (cloneData) {\n for (let i = 0; i < this.length; i++) {\n cloneRender.addChild(this.getChild(i).clone());\n }\n }\n return cloneRender;\n }\n\n}\n\n\nexport class DocumentBodyFactory extends ElementFactory<null> {\n match(type: string): boolean {\n return type === 'body';\n }\n createElement(data: any, renderCtx: RenderContenxtType): Element {\n const element = new DocumentBodyElement();\n return element;\n }\n\n}\n\n"]}
@@ -1,94 +0,0 @@
1
- import { BlockContainerElement, ElementFactory } from "../../element-define";
2
- import { ElementUtil } from "../../element-util";
3
- import { MuiltBlockLineRenderObject } from "../../render-define";
4
- import { BodyPartProps } from "../../element-props";
5
- /**
6
- * 用于合并病程录,每个part包含每份病程录body
7
- * 多个part处于一个body下面
8
- */
9
- export class DocumentBodyPartElement extends BlockContainerElement {
10
- //是否被修改
11
- isModify;
12
- constructor() {
13
- super('body-part');
14
- this.addEvent('ElementMousemove', (evt) => {
15
- this.isMouseenter = true;
16
- this.refreshView();
17
- });
18
- this.addEvent('ElementMouseLeave', (evt) => {
19
- this.isMouseenter = false;
20
- this.refreshView();
21
- });
22
- this.addEvent('GotCursor', (evt) => {
23
- this.isFocused = true;
24
- this.refreshView();
25
- });
26
- this.addEvent('LostCursor', (evt) => {
27
- this.isFocused = false;
28
- this.refreshView();
29
- });
30
- this.props = new BodyPartProps();
31
- }
32
- createRenderObject() {
33
- const render = new DocumentBodyPartRenderObject(this);
34
- render.margin.top = 10;
35
- render.margin.bottom = 10;
36
- return render;
37
- }
38
- serialize() {
39
- return {
40
- type: this.type,
41
- props: {
42
- partId: this.props.partId,
43
- }
44
- };
45
- }
46
- clone(data) {
47
- const clone = new DocumentBodyPartElement();
48
- clone.props.partId = this.props.partId;
49
- if (data) {
50
- for (let i = 0; i < this.length; i++) {
51
- clone.addChild(this.getChild(i).clone(true));
52
- }
53
- }
54
- return clone;
55
- }
56
- }
57
- export class DocumentBodyPartRenderObject extends MuiltBlockLineRenderObject {
58
- beginRender(ctx, position) {
59
- //if (ctx.drawMode === 'view' && (this.element.isFocused || this.element.isMouseenter)) {
60
- const borderColor = '#002766';
61
- ctx.overlaysContext.ctx.save();
62
- const bgColor = (this.element.isFocused || this.element.isMouseenter) ? '#d9d9d9' : '#ffffff';
63
- ctx.overlaysContext.fillRect(position.x - 2, position.y - 2, this.rect.width + 4, this.rect.height + 4, bgColor, 5, 'black');
64
- //ctx.overlaysContext.strokeRect(position.x, position.y, this.rect.width, this.rect.height, borderColor)
65
- ctx.overlaysContext.ctx.restore();
66
- //}
67
- }
68
- endRender(ctx, position) {
69
- }
70
- clone(cloneData = true) {
71
- const cloneRender = new DocumentBodyPartRenderObject(this.element);
72
- cloneRender.rect = ElementUtil.cloneRect(this.rect);
73
- cloneRender.margin.top = this.margin.top;
74
- cloneRender.margin.bottom = this.margin.bottom;
75
- if (cloneData) {
76
- for (let i = 0; i < this.length; i++) {
77
- cloneRender.addChild(this.getChild(i).clone());
78
- }
79
- }
80
- return cloneRender;
81
- }
82
- }
83
- export class DocumentBodyPartFactory extends ElementFactory {
84
- match(type) {
85
- return type === 'body-part';
86
- }
87
- createElement(data, renderCtx) {
88
- const bodyPart = data.props?.partId || '';
89
- const element = new DocumentBodyPartElement();
90
- element.props.partId = bodyPart;
91
- return element;
92
- }
93
- }
94
- //# sourceMappingURL=doc-body-part-impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doc-body-part-impl.js","sourceRoot":"lib/","sources":["framework/impl/document/doc-body-part-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA6C,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACxH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,0BAA0B,EAAgB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,qBAAoC;IAC7E,OAAO;IACP,QAAQ,CAAW;IACnB;QACI,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,GAAG,EAAE,EAAE;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE;YACvC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAC1B,IAAI,CAAC,WAAW,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,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,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;aAClD;SACJ;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;CAEJ;AAED,MAAM,OAAO,uBAAwB,SAAQ,cAA6B;IACtE,KAAK,CAAC,IAAY;QACd,OAAO,IAAI,KAAK,WAAW,CAAC;IAChC,CAAC;IACD,aAAa,CAAC,IAAqC,EAAE,SAA6B;QAC9E,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,IAAI,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAC9C,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC;QAChC,OAAO,OAAO,CAAC;IACnB,CAAC;CAEJ","sourcesContent":["import { BlockContainerElement, SerializeProps, Element, readElementProps, ElementFactory } from \"../../element-define\";\nimport { ElementUtil } from \"../../element-util\";\nimport { RenderContenxtType } from \"../../render-context\";\nimport { MuiltBlockLineRenderObject, RenderObject } from \"../../render-define\";\nimport { BodyPartProps } from \"../../element-props\";\n\n/**\n * 用于合并病程录,每个part包含每份病程录body\n * 多个part处于一个body下面\n */\nexport class DocumentBodyPartElement extends BlockContainerElement<BodyPartProps> {\n //是否被修改\n isModify!: boolean;\n constructor() {\n super('body-part');\n this.addEvent('ElementMousemove', (evt) => {\n this.isMouseenter = true;\n this.refreshView();\n });\n this.addEvent('ElementMouseLeave', (evt) => {\n this.isMouseenter = false;\n this.refreshView();\n });\n this.addEvent('GotCursor', (evt) => {\n this.isFocused = true;\n this.refreshView();\n });\n this.addEvent('LostCursor', (evt) => {\n this.isFocused = false;\n this.refreshView();\n });\n this.props = new BodyPartProps();\n }\n createRenderObject(): DocumentBodyPartRenderObject {\n const render = new DocumentBodyPartRenderObject(this);\n render.margin.top = 10;\n render.margin.bottom = 10;\n return render;\n }\n\n serialize(): SerializeProps {\n return {\n type: this.type,\n props: {\n partId: this.props.partId,\n }\n }\n }\n\n clone(data: boolean): DocumentBodyPartElement {\n const clone = new DocumentBodyPartElement();\n clone.props.partId = this.props.partId;\n if (data) {\n for (let i = 0; i < this.length; i++) {\n clone.addChild(this.getChild(i).clone(true));\n }\n }\n return clone;\n }\n}\n\n\nexport class DocumentBodyPartRenderObject extends MuiltBlockLineRenderObject {\n beginRender(ctx: RenderContenxtType, position: { x: number; y: number; }): void {\n //if (ctx.drawMode === 'view' && (this.element.isFocused || this.element.isMouseenter)) {\n const borderColor = '#002766';\n ctx.overlaysContext.ctx.save();\n const bgColor = (this.element.isFocused || this.element.isMouseenter) ? '#d9d9d9' : '#ffffff';\n ctx.overlaysContext.fillRect(position.x - 2, position.y - 2, this.rect.width + 4, this.rect.height + 4, bgColor, 5, 'black');\n //ctx.overlaysContext.strokeRect(position.x, position.y, this.rect.width, this.rect.height, borderColor)\n ctx.overlaysContext.ctx.restore();\n //}\n }\n endRender(ctx: RenderContenxtType, position: { x: number; y: number; }): void {\n\n }\n\n clone(cloneData = true): RenderObject {\n const cloneRender = new DocumentBodyPartRenderObject(this.element);\n cloneRender.rect = ElementUtil.cloneRect(this.rect);\n cloneRender.margin.top = this.margin.top;\n cloneRender.margin.bottom = this.margin.bottom;\n if (cloneData) {\n for (let i = 0; i < this.length; i++) {\n cloneRender.addChild(this.getChild(i).clone());\n }\n }\n return cloneRender;\n }\n\n}\n\nexport class DocumentBodyPartFactory extends ElementFactory<BodyPartProps>{\n match(type: string): boolean {\n return type === 'body-part';\n }\n createElement(data: readElementProps<BodyPartProps>, renderCtx: RenderContenxtType): Element<any> {\n const bodyPart = data.props?.partId || '';\n const element = new DocumentBodyPartElement();\n element.props.partId = bodyPart;\n return element;\n }\n\n}"]}
@@ -1,21 +0,0 @@
1
- import { BlockContainerRenderObject } from "../../render-define";
2
- export class DocumentContainerRender extends BlockContainerRenderObject {
3
- constructor() {
4
- super(null);
5
- }
6
- beginRender(ctx, position) {
7
- //throw new Error("Method not implemented.");
8
- }
9
- endRender(ctx, position) {
10
- //throw new Error("Method not implemented.");
11
- }
12
- clone() {
13
- throw new Error("Method not implemented.");
14
- }
15
- addPages(pages) {
16
- for (let i = 0; i < pages.length; i++) {
17
- this.addChild(pages[i]);
18
- }
19
- }
20
- }
21
- //# sourceMappingURL=doc-container-impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doc-container-impl.js","sourceRoot":"lib/","sources":["framework/impl/document/doc-container-impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAgB,MAAM,qBAAqB,CAAC;AAG/E,MAAM,OAAO,uBAAwB,SAAQ,0BAA0B;IACnE;QACI,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,WAAW,CAAC,GAAuB,EAAE,QAAmC;QACpE,6CAA6C;IACjD,CAAC;IACD,SAAS,CAAC,GAAuB,EAAE,QAAmC;QAClE,6CAA6C;IACjD,CAAC;IACD,KAAK;QACD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,QAAQ,CAAC,KAAkC;QACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SAC3B;IACL,CAAC;CACJ","sourcesContent":["import { RenderContenxtType } from \"../../render-context\";\nimport { BlockContainerRenderObject, RenderObject } from \"../../render-define\";\nimport { DocumentRenderObject } from \"./doc-impl\";\n\nexport class DocumentContainerRender extends BlockContainerRenderObject {\n constructor() {\n super(null);\n }\n beginRender(ctx: RenderContenxtType, position: { x: number; y: number; }): void {\n //throw new Error(\"Method not implemented.\");\n }\n endRender(ctx: RenderContenxtType, position: { x: number; y: number; }): void {\n //throw new Error(\"Method not implemented.\");\n }\n clone(): RenderObject {\n throw new Error(\"Method not implemented.\");\n }\n\n addPages(pages: Array<DocumentRenderObject>): void {\n for (let i = 0; i < pages.length; i++) {\n this.addChild(pages[i]);\n }\n }\n}\n"]}
@@ -1,77 +0,0 @@
1
- import { BlockContainerElement, ElementFactory } from "../../element-define";
2
- import { ElementUtil } from "../../element-util";
3
- import { BlockContainerRenderObject } from "../../render-define";
4
- export class DocumentFooterElement extends BlockContainerElement {
5
- constructor() {
6
- super('footer');
7
- //this.editMode = EditMode.Disabled;
8
- this.disableClick = true;
9
- this.addEvent('ElementDblClick', (evt) => {
10
- this.switchEditMode(evt);
11
- }, true);
12
- }
13
- clone(data) {
14
- const clone = new DocumentFooterElement();
15
- if (data) {
16
- for (let i = 0; i < this.length; i++) {
17
- clone.addChild(this.getChild(i).clone(true));
18
- }
19
- }
20
- return clone;
21
- }
22
- switchEditMode(evt) {
23
- const docElement = this.parent;
24
- docElement.switchPageHeaderEditor(evt.selectionState, this);
25
- return;
26
- }
27
- createRenderObject() {
28
- const renderObject = new DocumentFooterRenderObject(this);
29
- return renderObject;
30
- }
31
- serialize() {
32
- return {
33
- type: 'footer',
34
- props: {}
35
- };
36
- }
37
- }
38
- export class DocumentFooterRenderObject extends BlockContainerRenderObject {
39
- beginRender(ctx, position) {
40
- //判断页眉是否为输入内容
41
- const isFooterEmpty = ElementUtil.checkEmptyContent(this);
42
- if (this.element.disableClick && ctx.drawMode === 'view') {
43
- if (isFooterEmpty) {
44
- ctx.contentContext.setGlobalAlpha(0);
45
- return;
46
- }
47
- else {
48
- ctx.contentContext.setGlobalAlpha(0.5);
49
- }
50
- }
51
- }
52
- endRender(ctx, position) {
53
- ctx.contentContext.setGlobalAlpha(1);
54
- if (ctx.viewOptions.showDebug) {
55
- ctx.overlaysContext.fillRect(position.x, position.y, this.rect.width, this.rect.height, 'rgb(122,122,122,0.4)');
56
- }
57
- }
58
- clone() {
59
- const cloneRender = new DocumentFooterRenderObject(this.element);
60
- cloneRender.rect = ElementUtil.cloneRect(this.rect);
61
- for (let i = 0; i < this.length; i++) {
62
- cloneRender.addChild(this.getChild(i).clone());
63
- }
64
- return cloneRender;
65
- }
66
- }
67
- export class DocumentFooterFactory extends ElementFactory {
68
- match(type) {
69
- return type === 'footer';
70
- }
71
- createElement(data, renderCtx) {
72
- const element = new DocumentFooterElement();
73
- //element.renderCtx = renderCtx;
74
- return element;
75
- }
76
- }
77
- //# sourceMappingURL=doc-footer-impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doc-footer-impl.js","sourceRoot":"lib/","sources":["framework/impl/document/doc-footer-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAW,cAAc,EAAwB,MAAM,sBAAsB,CAAC;AAE5G,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,0BAA0B,EAAgB,MAAM,qBAAqB,CAAC;AAG/E,MAAM,OAAO,qBAAsB,SAAQ,qBAAqB;IAC5D;QACI,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,oCAAoC;QACpC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,GAAG,EAAE,EAAE;YACrC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC,EAAE,IAAI,CAAC,CAAC;IACb,CAAC;IACD,KAAK,CAAC,IAAa;QACf,MAAM,KAAK,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAC1C,IAAI,IAAI,EAAE;YACN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAClC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;aAChD;SACJ;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,cAAc,CAAC,GAAsB;QACjC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAyB,CAAC;QAClD,UAAU,CAAC,sBAAsB,CAAC,GAA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pD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAClC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;SAClD;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;CACJ;AAGD,MAAM,OAAO,qBAAsB,SAAQ,cAAoB;IAC3D,KAAK,CAAC,IAAY;QACd,OAAO,IAAI,KAAK,QAAQ,CAAC;IAC7B,CAAC;IAED,aAAa,CAAC,IAAS,EAAE,SAA6B;QAClD,MAAM,OAAO,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAC5C,gCAAgC;QAChC,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ","sourcesContent":["import { BlockContainerElement, Element, ElementFactory, Rect, SerializeProps } from \"../../element-define\";\nimport { MouseElementEvent } from \"../../element-event-define\";\nimport { ElementUtil } from \"../../element-util\";\nimport { RenderContenxtType } from \"../../render-context\";\nimport { BlockContainerRenderObject, RenderObject } from \"../../render-define\";\nimport { DocumentElement } from \"./doc-impl\";\n\nexport class DocumentFooterElement extends BlockContainerElement {\n constructor() {\n super('footer');\n //this.editMode = EditMode.Disabled;\n this.disableClick = true;\n this.addEvent('ElementDblClick', (evt) => {\n this.switchEditMode(evt);\n }, true);\n }\n clone(data: boolean): Element {\n const clone = new DocumentFooterElement();\n if (data) {\n for (let i = 0; i < this.length; i++) {\n clone.addChild(this.getChild(i).clone(true));\n }\n }\n return clone;\n }\n\n switchEditMode(evt: MouseElementEvent): void {\n const docElement = this.parent as DocumentElement;\n docElement.switchPageHeaderEditor(evt.selectionState, this);\n return;\n }\n\n createRenderObject(): DocumentFooterRenderObject {\n const renderObject = new DocumentFooterRenderObject(this);\n return renderObject;\n }\n\n serialize(): SerializeProps {\n return {\n type: 'footer',\n props: {}\n }\n }\n}\n\nexport class DocumentFooterRenderObject extends BlockContainerRenderObject {\n beginRender(ctx: RenderContenxtType, position: { x: number; y: number; }): void {\n //判断页眉是否为输入内容\n const isFooterEmpty = ElementUtil.checkEmptyContent(this);\n if (this.element.disableClick && ctx.drawMode === 'view') {\n if (isFooterEmpty) {\n ctx.contentContext.setGlobalAlpha(0);\n return;\n } else {\n ctx.contentContext.setGlobalAlpha(0.5);\n }\n }\n }\n\n endRender(ctx: RenderContenxtType, position: { x: number; y: number; }): void {\n ctx.contentContext.setGlobalAlpha(1);\n if (ctx.viewOptions.showDebug) {\n ctx.overlaysContext.fillRect(position.x, position.y, this.rect.width, this.rect.height, 'rgb(122,122,122,0.4)')\n }\n }\n\n clone(): RenderObject {\n const cloneRender = new DocumentFooterRenderObject(this.element);\n cloneRender.rect = ElementUtil.cloneRect(this.rect);\n for (let i = 0; i < this.length; i++) {\n cloneRender.addChild(this.getChild(i).clone());\n }\n return cloneRender;\n }\n}\n\n\nexport class DocumentFooterFactory extends ElementFactory<null> {\n match(type: string): boolean {\n return type === 'footer';\n }\n\n createElement(data: any, renderCtx: RenderContenxtType): Element {\n const element = new DocumentFooterElement();\n //element.renderCtx = renderCtx;\n return element;\n }\n}\n"]}