@hailin-zheng/editor-core 2.0.48 → 2.0.50
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/README.md +55 -34
- package/index-cjs.js +15 -2
- package/index-cjs.js.map +1 -1
- package/index.js +15 -2
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +7 -3
- package/med_editor/framework/document-change.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -141,42 +141,63 @@ editor-body.vue 的结构如下:
|
|
141
141
|
|
142
142
|
初始化编辑器,实例CanvasTextEditor对象,提供给子组件ref参数(docScroll, docHoldSpace, ruleCanvas, editCanvasContainer, editCanvas, editInput, editCursor, cursorWrapper)给CanvasTextEditor,获得编辑器对象。属性的修改和编辑器的方法均通过CanvasTextEditor暴露出来;
|
143
143
|
> 注意:这里需要引入类型 `editorContextType` (位于 emrComponents/code/types.ts 中)
|
144
|
+
|
144
145
|
```js
|
145
146
|
/** CanvasTextEditor实例属性 */
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
147
|
+
private
|
148
|
+
contentCtx: CanvasRenderingContext2D;
|
149
|
+
viewOptions: ViewOptions;
|
150
|
+
docCtx: EditorContext;
|
151
|
+
private
|
152
|
+
docComment: DocumentComment;
|
153
|
+
private
|
154
|
+
renderContext: RenderContext;
|
155
|
+
private
|
156
|
+
documentPaint: DocumentPaint;
|
157
|
+
elementReader: ElementReader;
|
158
|
+
private
|
159
|
+
documentEvent: DocumentEvent;
|
160
|
+
private
|
161
|
+
documentSelection: DocumentSelection;
|
162
|
+
private
|
163
|
+
documentInput: DocumentInput;
|
164
|
+
private
|
165
|
+
documentChange: DocumentChange;
|
166
|
+
private
|
167
|
+
selectionOverlays: SelectionOverlays;
|
168
|
+
private
|
169
|
+
docRule: DocRule;
|
170
|
+
private
|
171
|
+
eventMap: EventMap = new EventMap();
|
172
|
+
historyMange: ElementTrackManage;
|
173
|
+
selectionChanged: Subject < SelectionState > = new Subject();
|
174
|
+
beforeRenderSubject: Subject < void > = new Subject();
|
175
|
+
afterRenderSubject: Subject < void > = new Subject();
|
176
|
+
selectionState: SelectionState;
|
177
|
+
//显示右键菜单
|
178
|
+
onContextMenuItemChanged: Subject < EditorContextProps > = new Subject();
|
179
|
+
onDblClickEvent: Subject < Event > = new Subject();
|
180
|
+
onClickEvent: Subject < Event > = new Subject();
|
181
|
+
onScrollViewEvent: Subject < number > = new Subject();
|
182
|
+
//文档改变事件:内容及样式,业务模块需要根据此事件,来追踪当前文档是否改变的状态
|
183
|
+
onDocChangedEvent: Subject < void > = new Subject();
|
184
|
+
//执行flushTask,refreshDoc之前,此时可以在文档计算排版之前改变内容
|
185
|
+
onBeforeRefreshDocument: Subject < void > = new Subject();
|
186
|
+
.....
|
187
|
+
|
188
|
+
/** 实例化编辑器 */
|
189
|
+
const {
|
190
|
+
docScroll,
|
191
|
+
docHoldSpace,
|
192
|
+
ruleCanvas,
|
193
|
+
editCanvasContainer,
|
194
|
+
editCanvas,
|
195
|
+
editInput,
|
196
|
+
editCursor,
|
197
|
+
cursorWrapper
|
198
|
+
} = editorBodyRef.value;
|
199
|
+
let textEditor = new CanvasTextEditor(docScroll, docHoldSpace, ruleCanvas, editCanvasContainer, editCanvas, editInput, editCursor, cursorWrapper);
|
200
|
+
textEditor.createNewDoc();
|
180
201
|
|
181
202
|
```
|
182
203
|
<!-- /div -->
|
package/index-cjs.js
CHANGED
@@ -14846,6 +14846,8 @@ class DocumentArrange {
|
|
14846
14846
|
}
|
14847
14847
|
else {
|
14848
14848
|
cutCellRenders.push(null);
|
14849
|
+
//当前单元格可能是被上一个被截断过来的单元格,里面内容为空,此时无法截断,
|
14850
|
+
//但由于单元格高度被整行高度调整过,所以,不能被截断的单元格,在截断整行的情况下,需要重新计算高度
|
14849
14851
|
ElementUtil.remeasure(cellRender);
|
14850
14852
|
}
|
14851
14853
|
}
|
@@ -19298,6 +19300,7 @@ class DocumentChange {
|
|
19298
19300
|
/**
|
19299
19301
|
* 表单区域删除处理
|
19300
19302
|
* @param range
|
19303
|
+
* @param startPointElement
|
19301
19304
|
* @returns
|
19302
19305
|
*/
|
19303
19306
|
deleteRangeInFormEdit(range, startPointElement) {
|
@@ -26363,10 +26366,12 @@ class EditorCalendarVNode {
|
|
26363
26366
|
sel: 'input.editor-calendar-footer-left-time',
|
26364
26367
|
data: {
|
26365
26368
|
attrs: {
|
26369
|
+
type: 'time',
|
26370
|
+
step: '1',
|
26366
26371
|
value: this.currTime.value
|
26367
26372
|
},
|
26368
26373
|
on: {
|
26369
|
-
|
26374
|
+
blur: (event) => {
|
26370
26375
|
if (moment__default["default"](event.target.value, 'HH:mm:ss').isValid()) {
|
26371
26376
|
this.selectedTime.value = event.target.value;
|
26372
26377
|
}
|
@@ -26975,6 +26980,7 @@ class DocEditor {
|
|
26975
26980
|
selectionChanged = new Subject$1();
|
26976
26981
|
beforeRenderSubject = new Subject$1();
|
26977
26982
|
afterRenderSubject = new Subject$1();
|
26983
|
+
onBeforeSetCursorSubject = new Subject$1();
|
26978
26984
|
contentChanged = new Subject$1();
|
26979
26985
|
onShouldRender = new Subject$1();
|
26980
26986
|
selectionState;
|
@@ -27377,6 +27383,13 @@ class DocEditor {
|
|
27377
27383
|
* @returns
|
27378
27384
|
*/
|
27379
27385
|
canSetCursor() {
|
27386
|
+
//判断当前光标是否可以放置,可以设置返回true,否则返回false
|
27387
|
+
//用法:合并病程录,分开处理多个病程录录入权限
|
27388
|
+
const event = { result: true };
|
27389
|
+
this.onBeforeSetCursorSubject.next(event);
|
27390
|
+
if (!event.result) {
|
27391
|
+
return false;
|
27392
|
+
}
|
27380
27393
|
const { startControl, startOffset, editable } = this.selectionState;
|
27381
27394
|
return ElementUtil.canSetCursor(startControl, startOffset, editable, this.viewOptions);
|
27382
27395
|
}
|
@@ -28363,7 +28376,7 @@ class DocEditor {
|
|
28363
28376
|
rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
|
28364
28377
|
}
|
28365
28378
|
version() {
|
28366
|
-
return "2.0.
|
28379
|
+
return "2.0.50";
|
28367
28380
|
}
|
28368
28381
|
}
|
28369
28382
|
|