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