@hailin-zheng/editor-core 2.2.42 → 2.2.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/editor.css +679 -679
  2. package/index-cjs.d.ts +32 -32
  3. package/index-cjs.js +24462 -24462
  4. package/index-cjs.js.map +1 -1
  5. package/index.d.ts +32 -32
  6. package/index.js +24462 -24462
  7. package/index.js.map +1 -1
  8. package/med_editor/doc-editor.d.ts +547 -547
  9. package/med_editor/doc-rule.d.ts +174 -174
  10. package/med_editor/editor-core.d.ts +18 -18
  11. package/med_editor/framework/code-interpreter/ast-parser.d.ts +4 -4
  12. package/med_editor/framework/code-interpreter/document-eval-func.d.ts +18 -18
  13. package/med_editor/framework/code-interpreter/dynamic-execute.d.ts +42 -42
  14. package/med_editor/framework/doc-layout/document-arrange.d.ts +95 -95
  15. package/med_editor/framework/doc-layout/paragraph-arrange.d.ts +110 -110
  16. package/med_editor/framework/document-change.d.ts +346 -346
  17. package/med_editor/framework/document-combine.d.ts +24 -24
  18. package/med_editor/framework/document-comment.d.ts +38 -38
  19. package/med_editor/framework/document-context.d.ts +162 -162
  20. package/med_editor/framework/document-event.d.ts +261 -261
  21. package/med_editor/framework/document-input-cursor.d.ts +32 -32
  22. package/med_editor/framework/document-paginator.d.ts +46 -46
  23. package/med_editor/framework/document-svg.d.ts +36 -36
  24. package/med_editor/framework/document-template.d.ts +13 -13
  25. package/med_editor/framework/document-textline-mode.d.ts +6 -6
  26. package/med_editor/framework/element-define.d.ts +440 -440
  27. package/med_editor/framework/element-event-define.d.ts +102 -102
  28. package/med_editor/framework/element-props.d.ts +344 -344
  29. package/med_editor/framework/element-reader.d.ts +20 -20
  30. package/med_editor/framework/element-serialize.d.ts +39 -39
  31. package/med_editor/framework/element-type-handler.d.ts +8 -8
  32. package/med_editor/framework/history/element-trace-manage.d.ts +107 -107
  33. package/med_editor/framework/history/element-trace-tracking.d.ts +89 -89
  34. package/med_editor/framework/impl/checkbox/checkbox-impl.d.ts +19 -19
  35. package/med_editor/framework/impl/comments/comment-content-impl.d.ts +39 -39
  36. package/med_editor/framework/impl/comments/comment-element-impl.d.ts +24 -24
  37. package/med_editor/framework/impl/comments/comments-container-impl.d.ts +19 -19
  38. package/med_editor/framework/impl/comments/validate-msg-impl.d.ts +19 -19
  39. package/med_editor/framework/impl/data-element/data-container-impl.d.ts +25 -25
  40. package/med_editor/framework/impl/data-element/data-decorate-impl.d.ts +16 -16
  41. package/med_editor/framework/impl/data-element/data-element-barcode.d.ts +32 -32
  42. package/med_editor/framework/impl/data-element/data-element-base-impl.d.ts +122 -122
  43. package/med_editor/framework/impl/data-element/data-element-check-impl.d.ts +26 -26
  44. package/med_editor/framework/impl/data-element/data-element-date-impl.d.ts +23 -23
  45. package/med_editor/framework/impl/data-element/data-element-group-impl.d.ts +28 -28
  46. package/med_editor/framework/impl/data-element/data-element-image-impl.d.ts +23 -23
  47. package/med_editor/framework/impl/data-element/data-element-list-impl.d.ts +21 -21
  48. package/med_editor/framework/impl/data-element/data-element-text-impl.d.ts +22 -22
  49. package/med_editor/framework/impl/data-element/qrcode.d.ts +93 -93
  50. package/med_editor/framework/impl/decorate/fill-null-space-imple.d.ts +16 -16
  51. package/med_editor/framework/impl/document/doc-body-impl.d.ts +19 -19
  52. package/med_editor/framework/impl/document/doc-body-part-impl.d.ts +22 -22
  53. package/med_editor/framework/impl/document/doc-container-impl.d.ts +7 -7
  54. package/med_editor/framework/impl/document/doc-footer-impl.d.ts +19 -19
  55. package/med_editor/framework/impl/document/doc-header-impl.d.ts +19 -19
  56. package/med_editor/framework/impl/document/doc-impl.d.ts +85 -85
  57. package/med_editor/framework/impl/index.d.ts +41 -41
  58. package/med_editor/framework/impl/media-formula/menstrual-history.d.ts +31 -31
  59. package/med_editor/framework/impl/media-formula/permanent-teeth.d.ts +34 -34
  60. package/med_editor/framework/impl/paragraph/p-impl.d.ts +38 -38
  61. package/med_editor/framework/impl/picture/RectEle.d.ts +44 -44
  62. package/med_editor/framework/impl/picture/image-impl.d.ts +24 -24
  63. package/med_editor/framework/impl/radio/radio-impl.d.ts +17 -17
  64. package/med_editor/framework/impl/shape/line-impl.d.ts +31 -31
  65. package/med_editor/framework/impl/svg/svg-impl.d.ts +20 -20
  66. package/med_editor/framework/impl/symbol/br-symbol-impl.d.ts +18 -18
  67. package/med_editor/framework/impl/symbol/p-symbol-impl.d.ts +16 -16
  68. package/med_editor/framework/impl/symbol/page-br-symbol-impl.d.ts +20 -20
  69. package/med_editor/framework/impl/symbol/tab-symbol-impl.d.ts +15 -15
  70. package/med_editor/framework/impl/table/table-cell-impl.d.ts +34 -34
  71. package/med_editor/framework/impl/table/table-impl.d.ts +49 -49
  72. package/med_editor/framework/impl/table/table-row-impl.d.ts +27 -27
  73. package/med_editor/framework/impl/table/table-split-cell-patch.d.ts +20 -20
  74. package/med_editor/framework/impl/table/table-split-cell.d.ts +93 -93
  75. package/med_editor/framework/impl/table/table-util.d.ts +180 -180
  76. package/med_editor/framework/impl/text/text-impl.d.ts +34 -34
  77. package/med_editor/framework/impl/text/track-run-impl.d.ts +27 -27
  78. package/med_editor/framework/infrastructure/event-subject.d.ts +57 -57
  79. package/med_editor/framework/infrastructure/notify.d.ts +13 -13
  80. package/med_editor/framework/print/document-print-offscreen.d.ts +59 -59
  81. package/med_editor/framework/print/document-print.d.ts +19 -19
  82. package/med_editor/framework/render-context.d.ts +111 -111
  83. package/med_editor/framework/render-define.d.ts +169 -169
  84. package/med_editor/framework/search/search-panel.d.ts +31 -31
  85. package/med_editor/framework/selection/document-selection.d.ts +92 -92
  86. package/med_editor/framework/selection/range-util.d.ts +36 -36
  87. package/med_editor/framework/selection/selection-overlays.d.ts +36 -36
  88. package/med_editor/framework/suggestions/input-suggestions.d.ts +29 -29
  89. package/med_editor/framework/util/adjust-viewport-elements.d.ts +12 -12
  90. package/med_editor/framework/util/common-util.d.ts +78 -78
  91. package/med_editor/framework/util/document-segmenter.d.ts +2 -2
  92. package/med_editor/framework/util/element-util.d.ts +417 -417
  93. package/med_editor/framework/vnode/editor-calendar-vnode.d.ts +44 -44
  94. package/med_editor/framework/vnode/editor-list-vnode.d.ts +18 -18
  95. package/package.json +18 -18
@@ -1,24 +1,24 @@
1
- import { DocumentElement } from "./impl/document/doc-impl";
2
- /**
3
- * 文档合并
4
- */
5
- export declare class DocumentCombine {
6
- /**
7
- * 合并模板文档
8
- * 用于设置合并后,页眉页脚等统一部分
9
- */
10
- mainTemplate: DocumentElement;
11
- docParts: Array<{
12
- doc: DocumentElement;
13
- docId: string;
14
- }>;
15
- /**
16
- * 添加需要合并的文档部分
17
- */
18
- add(docPart: DocumentElement, id: string): void;
19
- dispose(): void;
20
- /**
21
- * 用于合并文档计算
22
- */
23
- load(): DocumentElement;
24
- }
1
+ import { DocumentElement } from "./impl/document/doc-impl";
2
+ /**
3
+ * 文档合并
4
+ */
5
+ export declare class DocumentCombine {
6
+ /**
7
+ * 合并模板文档
8
+ * 用于设置合并后,页眉页脚等统一部分
9
+ */
10
+ mainTemplate: DocumentElement;
11
+ docParts: Array<{
12
+ doc: DocumentElement;
13
+ docId: string;
14
+ }>;
15
+ /**
16
+ * 添加需要合并的文档部分
17
+ */
18
+ add(docPart: DocumentElement, id: string): void;
19
+ dispose(): void;
20
+ /**
21
+ * 用于合并文档计算
22
+ */
23
+ load(): DocumentElement;
24
+ }
@@ -1,38 +1,38 @@
1
- import { EditorContext } from "./document-context";
2
- import { CommentElement } from "./impl";
3
- /**
4
- * 处理文档批注
5
- */
6
- export declare class DocumentComment {
7
- docCtx: EditorContext;
8
- isDirty: boolean;
9
- constructor(docCtx: EditorContext);
10
- /**
11
- * 读取审阅标记符号
12
- */
13
- readComments(): void;
14
- /**
15
- * 执行删除前,需要更新批注节点位置
16
- */
17
- syncUpdateComments(): void;
18
- /**
19
- * 删除批注
20
- * @param id
21
- */
22
- removeComment(id: string): void;
23
- getCommMarkIndex(commMark: CommentElement): number;
24
- /**
25
- * 清除所有批注
26
- */
27
- clearAllComments(): void;
28
- /**
29
- * 清除所有的验证批注
30
- */
31
- clearAllValidates(): void;
32
- }
33
- export interface CommMarkSelectedStatus {
34
- startMark: CommentElement;
35
- endMark: CommentElement;
36
- startMarkStatus: boolean;
37
- endMarkStatus: boolean;
38
- }
1
+ import { EditorContext } from "./document-context";
2
+ import { CommentElement } from "./impl";
3
+ /**
4
+ * 处理文档批注
5
+ */
6
+ export declare class DocumentComment {
7
+ docCtx: EditorContext;
8
+ isDirty: boolean;
9
+ constructor(docCtx: EditorContext);
10
+ /**
11
+ * 读取审阅标记符号
12
+ */
13
+ readComments(): void;
14
+ /**
15
+ * 执行删除前,需要更新批注节点位置
16
+ */
17
+ syncUpdateComments(): void;
18
+ /**
19
+ * 删除批注
20
+ * @param id
21
+ */
22
+ removeComment(id: string): void;
23
+ getCommMarkIndex(commMark: CommentElement): number;
24
+ /**
25
+ * 清除所有批注
26
+ */
27
+ clearAllComments(): void;
28
+ /**
29
+ * 清除所有的验证批注
30
+ */
31
+ clearAllValidates(): void;
32
+ }
33
+ export interface CommMarkSelectedStatus {
34
+ startMark: CommentElement;
35
+ endMark: CommentElement;
36
+ startMarkStatus: boolean;
37
+ endMarkStatus: boolean;
38
+ }
@@ -1,162 +1,162 @@
1
- import { SelectionState } from "./selection/document-selection";
2
- import { BranchElement, Element, ElementHandler, Rect, RefreshType, ViewOptions } from "./element-define";
3
- import { ElementEvent, EventTypes } from "./element-event-define";
4
- import { DataElementValueStruct } from "./element-serialize";
5
- import { DataElementCheck, DataElementInlineGroup, DataElementLeaf, DocumentElement, TrackRunElement, TrackRunTypeEnum } from "./impl";
6
- import { DocumentChange } from "./document-change";
7
- import { opsTrackModel } from "./history/element-trace-tracking";
8
- import { Subject } from "./infrastructure/event-subject";
9
- import { DocInputSuggestions } from "./suggestions/input-suggestions";
10
- /**
11
- * 当前打开的文档的上下文信息,当前文档所有的属性设置都暴露在上下文中
12
- */
13
- export declare class EditorContext {
14
- readonly selectionState: SelectionState;
15
- readonly viewOptions: ViewOptions;
16
- isDirty: boolean;
17
- cursorRect: Rect | null;
18
- private _document;
19
- syncRefresh: () => void;
20
- docChange: DocumentChange;
21
- clearPrevDocCb: (() => void) | null;
22
- nextViewFns: Array<() => void>;
23
- commentFlag: boolean;
24
- trackFlag: boolean;
25
- suggestions: DocInputSuggestions;
26
- onKeyDownEvent: Subject<KeyboardEvent>;
27
- constructor(selectionState: SelectionState, viewOptions: ViewOptions);
28
- /**
29
- * 刷新视图
30
- */
31
- refreshView(): void;
32
- /**
33
- * 编辑器文档刷新后回调(DOM渲染完成后回调)
34
- * @param cb
35
- */
36
- onNextView(cb?: VoidFunction): void;
37
- get document(): DocumentElement;
38
- set document(value: DocumentElement);
39
- clear(): void;
40
- get defaultCtx(): DocumentContext;
41
- getCurrentCtx(ele: Element): DocumentContext;
42
- /**
43
- * 根据当前选区,返回所在的上下文元素,返回类型为DocumentElement|DocumentBodyPartElement
44
- */
45
- getCurrentEleCtx(): BranchElement | null;
46
- getCtx(ele: BranchElement): DocumentContext;
47
- /**
48
- * 注入右键菜单事件处理器
49
- * @param elementType 元素类型
50
- * @param eventName 事件名称
51
- * @param handler 回调处理函数
52
- * @param useCapture 是否为捕获阶段
53
- * @returns
54
- */
55
- registerTypeHandlers<F extends ElementEvent = ElementEvent>(elementType: any, eventName: EventTypes, handler: ElementHandler<F>, useCapture?: boolean): void;
56
- destroy(): void;
57
- /**
58
- * 切换行打印模式
59
- */
60
- switchTextlineMode(): void;
61
- /**
62
- * 替换数据元
63
- */
64
- replaceDataElement(oldDataElement: DataElementLeaf | DataElementInlineGroup, newElement: DataElementLeaf | DataElementInlineGroup, ss: SelectionState): void;
65
- currentRefreshType: RefreshType | null;
66
- currentOpsLog: Array<opsTrackModel>;
67
- get refreshType(): RefreshType | null;
68
- adaptiveScale(): number;
69
- }
70
- /**
71
- * 文档上下文
72
- */
73
- export declare class DocumentContext {
74
- ctx: BranchElement;
75
- private ss;
76
- constructor(ctx: BranchElement, ss: SelectionState);
77
- getControlIDList(): Array<string>;
78
- getControlInstanceList(options?: {
79
- includeChildren: boolean;
80
- }): Array<DataElementInlineGroup | DataElementLeaf>;
81
- getControlById(id: string): DataElementInlineGroup | DataElementLeaf;
82
- getControlByName(name: string): DataElementInlineGroup | DataElementLeaf;
83
- /**
84
- * 获取数据元值集合
85
- */
86
- getDataElementValues(): Array<DataElementValueStruct>;
87
- /**
88
- * 获取数据元结构以及get\set闭包调用函数
89
- * @returns
90
- */
91
- getDataElementModelList(options?: {
92
- includeChildren: boolean;
93
- }): Array<DataCheckEleModel | DataInputEleModel | DataLeafEleModel>;
94
- /**
95
- * 获取复选框数据元结构列表
96
- * @param dataCheckList
97
- * @returns
98
- */
99
- private getDataCheckModelList;
100
- /**
101
- * 获取留痕块元素列表
102
- */
103
- getTrackElements(): Array<TrackRunElement>;
104
- getTrackElementById(id: string): TrackRunElement | null;
105
- /**
106
- * 获取留痕块内数据
107
- */
108
- getTracksData(): Array<TrackBlockData>;
109
- setControlValue(id: string, value: string): void;
110
- setControlValueByName(name: string, val: any): void;
111
- /**
112
- * 获取复选框选中的值
113
- */
114
- getCheckBoxValues(groupName: string): Array<string>;
115
- getCheckBoxList(groupName: string): Array<DataElementCheck>;
116
- /**
117
- * 当前上下文执行默认绑定
118
- * @param data
119
- * @param predicateKey
120
- */
121
- bindDataValues(data: string | Object | Array<{
122
- key: string;
123
- value: any;
124
- }>, predicateKey?: 'id' | 'name' | 'fieldName'): void;
125
- /**
126
- * 查询字符
127
- * @param text
128
- */
129
- searchText(text: string): void;
130
- private getElementTextData;
131
- }
132
- interface DataEleBaseModel {
133
- id: string;
134
- name: string;
135
- fieldName: string;
136
- caption: string;
137
- getValue: () => any;
138
- setValue: (val: any) => void;
139
- }
140
- export interface DataCheckEleModel extends DataEleBaseModel {
141
- item: Array<DataElementCheck>;
142
- multiSelect: boolean;
143
- }
144
- export interface DataInputEleModel extends DataEleBaseModel {
145
- item: DataElementInlineGroup;
146
- }
147
- export interface DataLeafEleModel extends DataEleBaseModel {
148
- item: DataElementLeaf;
149
- }
150
- /**
151
- * 留痕块结构化数据
152
- */
153
- interface TrackBlockData {
154
- userId: string;
155
- userName: string;
156
- date: string;
157
- type: TrackRunTypeEnum;
158
- content: string;
159
- id: string;
160
- }
161
- export declare function refreshEditor(ele: Element): void;
162
- export {};
1
+ import { SelectionState } from "./selection/document-selection";
2
+ import { BranchElement, Element, ElementHandler, Rect, RefreshType, ViewOptions } from "./element-define";
3
+ import { ElementEvent, EventTypes } from "./element-event-define";
4
+ import { DataElementValueStruct } from "./element-serialize";
5
+ import { DataElementCheck, DataElementInlineGroup, DataElementLeaf, DocumentElement, TrackRunElement, TrackRunTypeEnum } from "./impl";
6
+ import { DocumentChange } from "./document-change";
7
+ import { opsTrackModel } from "./history/element-trace-tracking";
8
+ import { Subject } from "./infrastructure/event-subject";
9
+ import { DocInputSuggestions } from "./suggestions/input-suggestions";
10
+ /**
11
+ * 当前打开的文档的上下文信息,当前文档所有的属性设置都暴露在上下文中
12
+ */
13
+ export declare class EditorContext {
14
+ readonly selectionState: SelectionState;
15
+ readonly viewOptions: ViewOptions;
16
+ isDirty: boolean;
17
+ cursorRect: Rect | null;
18
+ private _document;
19
+ syncRefresh: () => void;
20
+ docChange: DocumentChange;
21
+ clearPrevDocCb: (() => void) | null;
22
+ nextViewFns: Array<() => void>;
23
+ commentFlag: boolean;
24
+ trackFlag: boolean;
25
+ suggestions: DocInputSuggestions;
26
+ onKeyDownEvent: Subject<KeyboardEvent>;
27
+ constructor(selectionState: SelectionState, viewOptions: ViewOptions);
28
+ /**
29
+ * 刷新视图
30
+ */
31
+ refreshView(): void;
32
+ /**
33
+ * 编辑器文档刷新后回调(DOM渲染完成后回调)
34
+ * @param cb
35
+ */
36
+ onNextView(cb?: VoidFunction): void;
37
+ get document(): DocumentElement;
38
+ set document(value: DocumentElement);
39
+ clear(): void;
40
+ get defaultCtx(): DocumentContext;
41
+ getCurrentCtx(ele: Element): DocumentContext;
42
+ /**
43
+ * 根据当前选区,返回所在的上下文元素,返回类型为DocumentElement|DocumentBodyPartElement
44
+ */
45
+ getCurrentEleCtx(): BranchElement | null;
46
+ getCtx(ele: BranchElement): DocumentContext;
47
+ /**
48
+ * 注入右键菜单事件处理器
49
+ * @param elementType 元素类型
50
+ * @param eventName 事件名称
51
+ * @param handler 回调处理函数
52
+ * @param useCapture 是否为捕获阶段
53
+ * @returns
54
+ */
55
+ registerTypeHandlers<F extends ElementEvent = ElementEvent>(elementType: any, eventName: EventTypes, handler: ElementHandler<F>, useCapture?: boolean): void;
56
+ destroy(): void;
57
+ /**
58
+ * 切换行打印模式
59
+ */
60
+ switchTextlineMode(): void;
61
+ /**
62
+ * 替换数据元
63
+ */
64
+ replaceDataElement(oldDataElement: DataElementLeaf | DataElementInlineGroup, newElement: DataElementLeaf | DataElementInlineGroup, ss: SelectionState): void;
65
+ currentRefreshType: RefreshType | null;
66
+ currentOpsLog: Array<opsTrackModel>;
67
+ get refreshType(): RefreshType | null;
68
+ adaptiveScale(): number;
69
+ }
70
+ /**
71
+ * 文档上下文
72
+ */
73
+ export declare class DocumentContext {
74
+ ctx: BranchElement;
75
+ private ss;
76
+ constructor(ctx: BranchElement, ss: SelectionState);
77
+ getControlIDList(): Array<string>;
78
+ getControlInstanceList(options?: {
79
+ includeChildren: boolean;
80
+ }): Array<DataElementInlineGroup | DataElementLeaf>;
81
+ getControlById(id: string): DataElementInlineGroup | DataElementLeaf;
82
+ getControlByName(name: string): DataElementInlineGroup | DataElementLeaf;
83
+ /**
84
+ * 获取数据元值集合
85
+ */
86
+ getDataElementValues(): Array<DataElementValueStruct>;
87
+ /**
88
+ * 获取数据元结构以及get\set闭包调用函数
89
+ * @returns
90
+ */
91
+ getDataElementModelList(options?: {
92
+ includeChildren: boolean;
93
+ }): Array<DataCheckEleModel | DataInputEleModel | DataLeafEleModel>;
94
+ /**
95
+ * 获取复选框数据元结构列表
96
+ * @param dataCheckList
97
+ * @returns
98
+ */
99
+ private getDataCheckModelList;
100
+ /**
101
+ * 获取留痕块元素列表
102
+ */
103
+ getTrackElements(): Array<TrackRunElement>;
104
+ getTrackElementById(id: string): TrackRunElement | null;
105
+ /**
106
+ * 获取留痕块内数据
107
+ */
108
+ getTracksData(): Array<TrackBlockData>;
109
+ setControlValue(id: string, value: string): void;
110
+ setControlValueByName(name: string, val: any): void;
111
+ /**
112
+ * 获取复选框选中的值
113
+ */
114
+ getCheckBoxValues(groupName: string): Array<string>;
115
+ getCheckBoxList(groupName: string): Array<DataElementCheck>;
116
+ /**
117
+ * 当前上下文执行默认绑定
118
+ * @param data
119
+ * @param predicateKey
120
+ */
121
+ bindDataValues(data: string | Object | Array<{
122
+ key: string;
123
+ value: any;
124
+ }>, predicateKey?: 'id' | 'name' | 'fieldName'): void;
125
+ /**
126
+ * 查询字符
127
+ * @param text
128
+ */
129
+ searchText(text: string): void;
130
+ private getElementTextData;
131
+ }
132
+ interface DataEleBaseModel {
133
+ id: string;
134
+ name: string;
135
+ fieldName: string;
136
+ caption: string;
137
+ getValue: () => any;
138
+ setValue: (val: any) => void;
139
+ }
140
+ export interface DataCheckEleModel extends DataEleBaseModel {
141
+ item: Array<DataElementCheck>;
142
+ multiSelect: boolean;
143
+ }
144
+ export interface DataInputEleModel extends DataEleBaseModel {
145
+ item: DataElementInlineGroup;
146
+ }
147
+ export interface DataLeafEleModel extends DataEleBaseModel {
148
+ item: DataElementLeaf;
149
+ }
150
+ /**
151
+ * 留痕块结构化数据
152
+ */
153
+ interface TrackBlockData {
154
+ userId: string;
155
+ userName: string;
156
+ date: string;
157
+ type: TrackRunTypeEnum;
158
+ content: string;
159
+ id: string;
160
+ }
161
+ export declare function refreshEditor(ele: Element): void;
162
+ export {};