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