@hailin-zheng/editor-core 1.1.2 → 1.1.3
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/controls/ScrollView.d.ts +1 -0
- package/controls/ViewPaint.d.ts +2 -2
- package/index-cjs.js +153 -61
- package/index-cjs.js.map +1 -1
- package/index.js +153 -62
- package/index.js.map +1 -1
- package/med_editor/framework/element-define.d.ts +3 -0
- package/med_editor/framework/event-subject.d.ts +3 -1
- package/med_editor/framework/impl/data-element/data-element-base-impl.d.ts +5 -0
- package/med_editor/framework/impl/data-element/data-element-group-impl.d.ts +1 -2
- package/med_editor/framework/paragraph-arrange.d.ts +1 -0
- package/med_editor/framework/render-context.d.ts +3 -2
- package/med_editor/framework/render-define.d.ts +1 -0
- package/med_editor/texteditor.d.ts +3 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -366,6 +366,7 @@ class BlockContentRenderObject extends BranchRenderObject {
|
|
366
366
|
}
|
367
367
|
}
|
368
368
|
class InlineGroupRenderObject extends BranchRenderObject {
|
369
|
+
paintPos;
|
369
370
|
}
|
370
371
|
/**
|
371
372
|
* 包含块级渲染元素的容器元素,例如body、table-cell等
|
@@ -907,8 +908,10 @@ class Subject$1 extends EventSourceCore$1 {
|
|
907
908
|
this.addSub(sub);
|
908
909
|
return sub;
|
909
910
|
}
|
910
|
-
|
911
|
-
|
911
|
+
}
|
912
|
+
class OnceSubject extends Subject$1 {
|
913
|
+
subscribe(listener) {
|
914
|
+
const sub = super.subscribe(listener);
|
912
915
|
sub.once = true;
|
913
916
|
return sub;
|
914
917
|
}
|
@@ -1295,13 +1298,23 @@ class BranchElement extends Element {
|
|
1295
1298
|
}
|
1296
1299
|
else {
|
1297
1300
|
this.modifyFlag = ModifyFlag$1.Modify;
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
+
clearChildrenRenderCache(this);
|
1302
|
+
// for (let i = 0; i < this.length; i++) {
|
1303
|
+
// this.getChild(i).pubOnChange('to-child')
|
1304
|
+
// }
|
1301
1305
|
}
|
1302
1306
|
this._onChangeEvent.next();
|
1303
1307
|
}
|
1304
1308
|
}
|
1309
|
+
function clearChildrenRenderCache(ele) {
|
1310
|
+
for (let i = 0; i < ele.length; i++) {
|
1311
|
+
const curr = ele.getChild(i);
|
1312
|
+
curr.cacheRender = null;
|
1313
|
+
if (curr instanceof BranchElement) {
|
1314
|
+
clearChildrenRenderCache(curr);
|
1315
|
+
}
|
1316
|
+
}
|
1317
|
+
}
|
1305
1318
|
/**
|
1306
1319
|
* 行内编组元素
|
1307
1320
|
*/
|
@@ -1415,6 +1428,8 @@ class ViewOptions {
|
|
1415
1428
|
defaultColor = "rgb(0,0,0)";
|
1416
1429
|
selectionOverlaysColor = 'rgb(131,175,155,0.5)';
|
1417
1430
|
dataEleOverlaysColor = 'rgb(131,175,155,0.5)';
|
1431
|
+
dataEleFocusedBgColor = 'rgb(131,175,155,0.8)';
|
1432
|
+
dataEleErrorBgColor = '#ff4d4f';
|
1418
1433
|
dataEleReadOnlyOverlayColor = '#d9d9d9';
|
1419
1434
|
dataEleOutlineColor = 'rgb(131,175,155,0.7)';
|
1420
1435
|
viewBackcolor = 'rgb(230,230,230)';
|
@@ -1446,6 +1461,8 @@ class ViewOptions {
|
|
1446
1461
|
enableDyExpression = false;
|
1447
1462
|
//是否显示标尺
|
1448
1463
|
showRule = true;
|
1464
|
+
//是否开启数据元输入验证功能
|
1465
|
+
enableDataEleInputValidate = false;
|
1449
1466
|
//整页模式,不分页
|
1450
1467
|
_fullPageView = false;
|
1451
1468
|
get fullPageView() {
|
@@ -3650,8 +3667,12 @@ class InlineGroupInputElement extends InlineGroupElement {
|
|
3650
3667
|
}
|
3651
3668
|
}
|
3652
3669
|
class DataElementInlineGroup extends InlineGroupInputElement {
|
3670
|
+
errorTip;
|
3653
3671
|
constructor(type) {
|
3654
3672
|
super(type);
|
3673
|
+
this.onChangeSubject.subscribe(() => {
|
3674
|
+
this.onChangedValidate();
|
3675
|
+
});
|
3655
3676
|
this.addEvent('ElementMousemove', (evt) => {
|
3656
3677
|
this.isMouseenter = true;
|
3657
3678
|
this.refreshView();
|
@@ -3715,6 +3736,21 @@ class DataElementInlineGroup extends InlineGroupInputElement {
|
|
3715
3736
|
this.expressFn = new Function();
|
3716
3737
|
}
|
3717
3738
|
}
|
3739
|
+
/**
|
3740
|
+
* 数据元发生更改后,进行数据验证
|
3741
|
+
*/
|
3742
|
+
onChangedValidate() {
|
3743
|
+
this.errorTip = '';
|
3744
|
+
const options = getCurrOptions(this);
|
3745
|
+
if (!options || !options.enableDataEleInputValidate) {
|
3746
|
+
return;
|
3747
|
+
}
|
3748
|
+
this.errorTip = this.validate();
|
3749
|
+
}
|
3750
|
+
}
|
3751
|
+
function getCurrOptions(ele) {
|
3752
|
+
const doc = ElementUtil.getParent(ele, item => item.type === 'doc');
|
3753
|
+
return doc?.viewOptions;
|
3718
3754
|
}
|
3719
3755
|
class DataElementRenderObject extends InlineGroupRenderObject {
|
3720
3756
|
render(e) {
|
@@ -3725,9 +3761,18 @@ class DataElementRenderObject extends InlineGroupRenderObject {
|
|
3725
3761
|
}
|
3726
3762
|
render.contentContext.tran(() => {
|
3727
3763
|
//绘制数据元区域底色
|
3764
|
+
let bgColor = '';
|
3728
3765
|
if (this.element.isMouseenter) {
|
3729
|
-
|
3730
|
-
|
3766
|
+
bgColor = this.element.props.editable ? viewOptions.dataEleOverlaysColor : viewOptions.dataEleReadOnlyOverlayColor;
|
3767
|
+
}
|
3768
|
+
if (this.element.isFocused) {
|
3769
|
+
bgColor = e.docCtx.viewOptions.dataEleFocusedBgColor;
|
3770
|
+
}
|
3771
|
+
if (this.element.errorTip) {
|
3772
|
+
bgColor = viewOptions.dataEleErrorBgColor;
|
3773
|
+
}
|
3774
|
+
if (bgColor) {
|
3775
|
+
render.overlaysContext.fillRect(position.x, position.y - 2, this.rect.width, this.rect.height + 4, bgColor);
|
3731
3776
|
}
|
3732
3777
|
if (this.element.props.secretBrowse && viewOptions.secretBrowse) {
|
3733
3778
|
render.contentContext.ctx.filter = "blur(10px)";
|
@@ -3749,23 +3794,25 @@ class DataElementRenderObject extends InlineGroupRenderObject {
|
|
3749
3794
|
* @private
|
3750
3795
|
*/
|
3751
3796
|
drawCaption(e) {
|
3752
|
-
|
3753
|
-
|
3754
|
-
|
3755
|
-
|
3756
|
-
|
3757
|
-
|
3797
|
+
e.render.onRenderCompleted.subscribe(() => {
|
3798
|
+
const { render, position, docCtx: { viewOptions } } = e;
|
3799
|
+
//获取到焦点时,绘制数据元标题
|
3800
|
+
if (render.drawMode === 'view' && this.element.isFocused && this.element.paintRenders.indexOf(this) === 0) {
|
3801
|
+
const { caption } = this.element.props;
|
3802
|
+
if (!caption) {
|
3803
|
+
return;
|
3804
|
+
}
|
3805
|
+
const textProps = new TextProps();
|
3806
|
+
textProps.fontSize = 16;
|
3807
|
+
textProps.fontName = viewOptions.defaultFontName;
|
3808
|
+
textProps.color = '#fff';
|
3809
|
+
const titleWidth = render.contentContext.measureText(caption, textProps).width;
|
3810
|
+
const x = position.x;
|
3811
|
+
const y = position.y - 20;
|
3812
|
+
render.contentContext.fillRect(x, y, titleWidth + 10, 20, 'blue');
|
3813
|
+
render.contentContext.drawText(caption, textProps, x + 5, y, titleWidth, 20);
|
3758
3814
|
}
|
3759
|
-
|
3760
|
-
textProps.fontSize = 16;
|
3761
|
-
textProps.fontName = viewOptions.defaultFontName;
|
3762
|
-
textProps.color = '#fff';
|
3763
|
-
const titleWidth = render.contentContext.measureText(caption, textProps).width;
|
3764
|
-
const x = position.x;
|
3765
|
-
const y = position.y - 20;
|
3766
|
-
render.contentContext.fillRect(x, y, titleWidth + 10, 20, 'blue');
|
3767
|
-
render.contentContext.drawText(caption, textProps, x + 5, y, titleWidth, 20);
|
3768
|
-
}
|
3815
|
+
});
|
3769
3816
|
}
|
3770
3817
|
}
|
3771
3818
|
const validateDataEle = (ele) => {
|
@@ -4550,6 +4597,9 @@ class TableCellElement extends BlockContainerElement {
|
|
4550
4597
|
throw new Error('row is null');
|
4551
4598
|
}
|
4552
4599
|
const table = row.parent;
|
4600
|
+
if (!table) {
|
4601
|
+
debugger;
|
4602
|
+
}
|
4553
4603
|
const cellIndex = row.getChildIndex(this);
|
4554
4604
|
let cellWidth = table.getCellWidth(cellIndex);
|
4555
4605
|
const cellOffset = table.getCellOffsetX(cellIndex);
|
@@ -7595,8 +7645,7 @@ class RenderContext {
|
|
7595
7645
|
drawMode = 'view';
|
7596
7646
|
contentOffCanvas;
|
7597
7647
|
overlayOffCanvas;
|
7598
|
-
|
7599
|
-
onRenderCompleted = new Subject$1();
|
7648
|
+
onRenderCompleted = new OnceSubject();
|
7600
7649
|
constructor(mainContext) {
|
7601
7650
|
this.mainContext = mainContext;
|
7602
7651
|
}
|
@@ -7618,7 +7667,6 @@ class RenderContext {
|
|
7618
7667
|
this.pageRect = { x: 0, y: 0, width: pageSetting.width, height: pageSetting.height };
|
7619
7668
|
ElementUtil.setCanvasProps(this.contentOffCanvas, this.contentContext.ctx, pageSetting);
|
7620
7669
|
ElementUtil.setCanvasProps(this.overlayOffCanvas, this.overlaysContext.ctx, pageSetting);
|
7621
|
-
//ElementUtil.setCanvasProps(this.mainContext.ctx.canvas, this.mainContext.ctx, pageSetting)
|
7622
7670
|
}
|
7623
7671
|
clear() {
|
7624
7672
|
this.contentContext.clear();
|
@@ -8657,7 +8705,7 @@ class DataElementDate extends DataElementInlineGroup {
|
|
8657
8705
|
this.props.valueTextProps.clone(valueText.props);
|
8658
8706
|
valueText.text = formatStr;
|
8659
8707
|
this.addChild(valueText, this.length - 1);
|
8660
|
-
|
8708
|
+
this.onChangedValidate();
|
8661
8709
|
}
|
8662
8710
|
getValue() {
|
8663
8711
|
return ElementSerialize.serializeString(this);
|
@@ -8747,9 +8795,9 @@ class DataElementGroupElement extends InlineGroupInputElement {
|
|
8747
8795
|
}
|
8748
8796
|
}
|
8749
8797
|
class DataElementGroupRenderObject extends InlineGroupRenderObject {
|
8750
|
-
paintPos;
|
8751
8798
|
render(e) {
|
8752
8799
|
this.paintPos = e.position;
|
8800
|
+
e.render.onRenderCompleted.subscribe(() => { this.paintDecorate(e); });
|
8753
8801
|
}
|
8754
8802
|
getCurrentParaGroupRenders() {
|
8755
8803
|
const renders = [];
|
@@ -8762,7 +8810,7 @@ class DataElementGroupRenderObject extends InlineGroupRenderObject {
|
|
8762
8810
|
}
|
8763
8811
|
return renders;
|
8764
8812
|
}
|
8765
|
-
|
8813
|
+
paintDecorate(e) {
|
8766
8814
|
const { render, docCtx: { viewOptions } } = e;
|
8767
8815
|
const canPaint = this.element.isMouseenter || this.element.isFocused;
|
8768
8816
|
if (canPaint && this.element.paintRenders.indexOf(this) === 0) {
|
@@ -9023,6 +9071,7 @@ class DataElementList extends DataElementInlineGroup {
|
|
9023
9071
|
this.addChild(valueText, this.length - 1);
|
9024
9072
|
}
|
9025
9073
|
}
|
9074
|
+
this.onChangedValidate();
|
9026
9075
|
}
|
9027
9076
|
getValue() {
|
9028
9077
|
const values = ElementSerialize.serializeString(this);
|
@@ -9116,6 +9165,7 @@ class DataElementText extends DataElementInlineGroup {
|
|
9116
9165
|
valueText.text = val + '';
|
9117
9166
|
this.addChild(valueText, this.length - 1);
|
9118
9167
|
}
|
9168
|
+
this.onChangedValidate();
|
9119
9169
|
}
|
9120
9170
|
getValue() {
|
9121
9171
|
return ElementSerialize.serializeString(this, { all: false });
|
@@ -10952,8 +11002,6 @@ class ElementPaint {
|
|
10952
11002
|
}
|
10953
11003
|
paintPagePos;
|
10954
11004
|
drawPages(docContainer, selectedSets) {
|
10955
|
-
// this.rePaint = rePaint;
|
10956
|
-
//this.measureCommContainer = measureCommContainer;
|
10957
11005
|
this.selectedSets = selectedSets;
|
10958
11006
|
const pageCount = docContainer.length;
|
10959
11007
|
const containerPos = { x: docContainer.rect.x - this.viewOptions.pageOffset.x, y: docContainer.rect.y - this.viewOptions.pageOffset.y };
|
@@ -10979,13 +11027,13 @@ class ElementPaint {
|
|
10979
11027
|
});
|
10980
11028
|
nextRenderFn();
|
10981
11029
|
const { scale, viewSettings: { width, height } } = this.viewOptions;
|
11030
|
+
while (this.renderCtx.onRenderCompleted.subs.length > 0) {
|
11031
|
+
this.renderCtx.onRenderCompleted.next();
|
11032
|
+
}
|
10982
11033
|
this.renderCtx.commit({ width, height, scale }, this.viewOptions.pageOffset);
|
10983
11034
|
}
|
10984
11035
|
drawRenderObject(renderObject, parent, parentInViewPort = false) {
|
10985
11036
|
const element = renderObject.element;
|
10986
|
-
// if (this.rePaint && element) {
|
10987
|
-
// //element.paintRenders.push(renderObject);
|
10988
|
-
// }
|
10989
11037
|
const { x: rx, y: ry, width: rw, height: rh } = renderObject.rect;
|
10990
11038
|
const currPosition = { x: rx + parent.x, y: ry + parent.y };
|
10991
11039
|
//判断当前绘制元素是否在视窗内
|
@@ -11025,18 +11073,6 @@ class ElementPaint {
|
|
11025
11073
|
};
|
11026
11074
|
renderObject.render(renderData);
|
11027
11075
|
}
|
11028
|
-
// //审阅信息
|
11029
|
-
// if (this.viewOptions.showReviewWindow && element && element.type === 'comm') {
|
11030
|
-
// const commElement = element as CommentElement;
|
11031
|
-
// if (commElement.props.markType === 'start') {
|
11032
|
-
// //获取当前绘制元素相对于当前页的坐标
|
11033
|
-
// this.paintCommMap.push({
|
11034
|
-
// ele: commElement,
|
11035
|
-
// render: renderObject,
|
11036
|
-
// pos: { x: currPosition.x - this.paintPagePos.x, y: currPosition.y - this.paintPagePos.y }
|
11037
|
-
// });
|
11038
|
-
// }
|
11039
|
-
// }
|
11040
11076
|
}
|
11041
11077
|
//处理选中拖蓝
|
11042
11078
|
if (inViewPort && this.selectedSets.has(element)) {
|
@@ -11472,6 +11508,7 @@ class EditorContext {
|
|
11472
11508
|
this.clearPrevDocCb?.();
|
11473
11509
|
//this.ele_types_handlers.length = 0;
|
11474
11510
|
this.imageLoader.clear();
|
11511
|
+
this._document = null;
|
11475
11512
|
}
|
11476
11513
|
/**
|
11477
11514
|
* 切换行打印模式
|
@@ -11851,6 +11888,8 @@ class DynamicContextParser {
|
|
11851
11888
|
TableData(tableId, startRow, startCol, endRow, endCol) {
|
11852
11889
|
const tb = this.doc.treeFind(item => item instanceof TableElement && item.props.id === tableId);
|
11853
11890
|
const res = [];
|
11891
|
+
startRow = startRow < 0 ? tb.length + startRow : startRow;
|
11892
|
+
startCol = startCol < 0 ? tb.length + startCol : startCol;
|
11854
11893
|
endRow = endRow < 0 ? tb.length + endRow : endRow;
|
11855
11894
|
endCol = endCol < 0 ? tb.length + endCol : endCol;
|
11856
11895
|
for (let i = startRow; i <= endRow; i++) {
|
@@ -12228,8 +12267,15 @@ class ParagraphMeasure {
|
|
12228
12267
|
}
|
12229
12268
|
}
|
12230
12269
|
}
|
12231
|
-
|
12232
|
-
|
12270
|
+
this.arrangeInlineItems(data, ele.getChild(i));
|
12271
|
+
}
|
12272
|
+
}
|
12273
|
+
arrangeInlineItems(parentLine, ele) {
|
12274
|
+
if (ele instanceof InlineGroupElement) {
|
12275
|
+
this.arrangeInlineGroupElement(parentLine, ele);
|
12276
|
+
}
|
12277
|
+
else {
|
12278
|
+
this.arrange(parentLine, ele);
|
12233
12279
|
}
|
12234
12280
|
}
|
12235
12281
|
arrangeLeafElement(parentLine, ele) {
|
@@ -12606,7 +12652,9 @@ class DocumentArrange {
|
|
12606
12652
|
continue;
|
12607
12653
|
}
|
12608
12654
|
if (Array.isArray(childRender)) {
|
12609
|
-
|
12655
|
+
if (childRender.length > 1) {
|
12656
|
+
element.cacheRender = null;
|
12657
|
+
}
|
12610
12658
|
for (let j = 0; j < childRender.length; j++) {
|
12611
12659
|
if (j > 0) {
|
12612
12660
|
render = this.createRenderObject(element);
|
@@ -18278,7 +18326,6 @@ function getCurrentActiveAppContext() {
|
|
18278
18326
|
function setCurrentActiveAppContext(ctx) {
|
18279
18327
|
currentActiveAppContext = ctx;
|
18280
18328
|
}
|
18281
|
-
let taskId;
|
18282
18329
|
function renderApp(root, renderCtx, nodeEvent) {
|
18283
18330
|
window['root'] = root;
|
18284
18331
|
// const nodeEvent = new NodeEvent(root, renderCtx.mainContext.ctx.canvas);
|
@@ -18288,15 +18335,13 @@ function renderApp(root, renderCtx, nodeEvent) {
|
|
18288
18335
|
return;
|
18289
18336
|
}
|
18290
18337
|
delayTask = true;
|
18291
|
-
|
18292
|
-
console.log(taskId + "正在运行中");
|
18338
|
+
setTimeout(() => {
|
18293
18339
|
currentActiveAppContext = { root, render: flushTask };
|
18294
18340
|
delayTask = false;
|
18295
18341
|
root.clearPopNodes();
|
18296
18342
|
prepareRender(root, renderCtx, nodeEvent.appState);
|
18297
18343
|
updateCursor(nodeEvent, renderCtx);
|
18298
18344
|
currentActiveAppContext = null;
|
18299
|
-
console.log(taskId + "运行完成");
|
18300
18345
|
}, 16);
|
18301
18346
|
};
|
18302
18347
|
flushTask();
|
@@ -19237,7 +19282,7 @@ function invokeNodeEvent(node, event, name, useCapture) {
|
|
19237
19282
|
|
19238
19283
|
class ViewPaint {
|
19239
19284
|
ctx;
|
19240
|
-
onRenderCompleted = new
|
19285
|
+
onRenderCompleted = new OnceSubject();
|
19241
19286
|
pageSetting;
|
19242
19287
|
pageRect;
|
19243
19288
|
constructor(ctx) {
|
@@ -20000,7 +20045,7 @@ class MenuContainer extends NodeItems {
|
|
20000
20045
|
}
|
20001
20046
|
preRender(e) {
|
20002
20047
|
const { render, renderPos, next } = e;
|
20003
|
-
e.render.onRenderCompleted.
|
20048
|
+
e.render.onRenderCompleted.subscribe((render) => {
|
20004
20049
|
e.appState.surface.registerPopNode(this);
|
20005
20050
|
const parentPos = { x: renderPos.x - this.finalRect.x, y: renderPos.y - this.finalRect.y };
|
20006
20051
|
render.tran(() => {
|
@@ -20074,11 +20119,31 @@ class ScrollView extends NodeItems {
|
|
20074
20119
|
});
|
20075
20120
|
this.addEventListener('wheel', evt => {
|
20076
20121
|
const { deltaY, deltaX } = evt;
|
20077
|
-
console.log(`deltaX:${deltaX},deltaY:${deltaY}`);
|
20078
20122
|
this.horBar.updateScrollByCurrent(deltaX / 10, deltaY / 10);
|
20079
20123
|
this.verBar.updateScrollByCurrent(deltaX / 10, deltaY / 10);
|
20080
20124
|
});
|
20081
20125
|
}
|
20126
|
+
scrollTo(x, y) {
|
20127
|
+
if (!this.content.finalRect || !this.finalRect) {
|
20128
|
+
return;
|
20129
|
+
}
|
20130
|
+
if (y > this.content.finalRect.height) {
|
20131
|
+
y = this.content.finalRect.height;
|
20132
|
+
}
|
20133
|
+
if (x > this.content.finalRect.width) {
|
20134
|
+
x = this.content.finalRect.width;
|
20135
|
+
}
|
20136
|
+
let scrollX = x - this.finalRect.width;
|
20137
|
+
let scrollY = y - this.finalRect.height;
|
20138
|
+
scrollX = scrollX < 0 ? 0 : scrollX;
|
20139
|
+
scrollY = scrollY < 0 ? 0 : scrollY;
|
20140
|
+
this.scrollX = scrollX;
|
20141
|
+
this.scrollY = scrollY;
|
20142
|
+
this.onScrollEvent.next({
|
20143
|
+
x: this.scrollX,
|
20144
|
+
y: this.scrollY
|
20145
|
+
});
|
20146
|
+
}
|
20082
20147
|
measureOverride(e, availableSize) {
|
20083
20148
|
const measureSize = availableSize;
|
20084
20149
|
this.content.measure(e, measureSize);
|
@@ -20301,10 +20366,6 @@ class ScrollBar extends NodeItems {
|
|
20301
20366
|
const x = this.orientation === 'horizontal' ? (scrollView.scrollX / scrollView.content.finalRect.width) * finalSize.width : (ScrollBarSize - this.thumbSize) / 2;
|
20302
20367
|
const y = this.orientation === 'horizontal' ? (ScrollBarSize - this.thumbSize) / 2 : (scrollView.scrollY / scrollView.content.finalRect.height) * finalSize.height;
|
20303
20368
|
this.thumb.arrange(e, { x, y, width, height });
|
20304
|
-
if (this.orientation === 'vertical') {
|
20305
|
-
console.log(y, height, finalSize.width, finalSize.height, scrollView.scrollY);
|
20306
|
-
if (scrollView.scrollY === 4.723577235772358) ;
|
20307
|
-
}
|
20308
20369
|
return super.arrangeOverride(e, finalSize);
|
20309
20370
|
}
|
20310
20371
|
render(e) {
|
@@ -20408,6 +20469,9 @@ class RuleControl extends NodeItems {
|
|
20408
20469
|
super();
|
20409
20470
|
this.docCtx = docCtx;
|
20410
20471
|
this.ss = docCtx.selectionState;
|
20472
|
+
this.bgColor = '#fff';
|
20473
|
+
this.shadowBlur = 5;
|
20474
|
+
this.shadowColor = '#000';
|
20411
20475
|
this.options = {
|
20412
20476
|
width: 0,
|
20413
20477
|
pagePL: 0,
|
@@ -21107,7 +21171,7 @@ class CanvasTextEditor extends NodeItems {
|
|
21107
21171
|
*/
|
21108
21172
|
docClickHandle(evt) {
|
21109
21173
|
this.setCursor();
|
21110
|
-
this.
|
21174
|
+
this.updateSelection();
|
21111
21175
|
this.onClickEvent.next(evt);
|
21112
21176
|
}
|
21113
21177
|
/**
|
@@ -21119,6 +21183,7 @@ class CanvasTextEditor extends NodeItems {
|
|
21119
21183
|
if (res) {
|
21120
21184
|
this.flushToSchedule();
|
21121
21185
|
}
|
21186
|
+
this.updateSelection();
|
21122
21187
|
this.onDblClickEvent.next(evt);
|
21123
21188
|
}
|
21124
21189
|
/**
|
@@ -21525,6 +21590,7 @@ class CanvasTextEditor extends NodeItems {
|
|
21525
21590
|
return;
|
21526
21591
|
}
|
21527
21592
|
//this.docScroll.scrollTo(cursorPos.rect.x, cursorPos.rect.y - this.viewOptions.translateY);
|
21593
|
+
this.scrollView.scrollTo(cursorPos.rect.x, cursorPos.rect.y + 100);
|
21528
21594
|
}
|
21529
21595
|
}
|
21530
21596
|
/**
|
@@ -21681,6 +21747,13 @@ class CanvasTextEditor extends NodeItems {
|
|
21681
21747
|
scrollView.y = 30;
|
21682
21748
|
this.scrollView = scrollView;
|
21683
21749
|
scrollView.content.addChild(this);
|
21750
|
+
const label = new LabelNode();
|
21751
|
+
label.text = '请注意了';
|
21752
|
+
label.bgColor = '#fff';
|
21753
|
+
label.padding = 2;
|
21754
|
+
label.x = 100;
|
21755
|
+
label.y = 100;
|
21756
|
+
//this.addChild(label);
|
21684
21757
|
scrollView.onScrollEvent.subscribe(data => {
|
21685
21758
|
//console.log(data);
|
21686
21759
|
this.viewOptions.pageOffset.x = data.x;
|
@@ -21784,6 +21857,24 @@ class CanvasTextEditor extends NodeItems {
|
|
21784
21857
|
appCtx.root.setInputPosition(caretPos);
|
21785
21858
|
}
|
21786
21859
|
}
|
21860
|
+
measureOverride(e, availableSize) {
|
21861
|
+
this.controls.forEach(item => {
|
21862
|
+
item.measure(e, availableSize);
|
21863
|
+
});
|
21864
|
+
return super.measureOverride(e, availableSize);
|
21865
|
+
}
|
21866
|
+
arrangeOverride(e, finalSize) {
|
21867
|
+
this.controls.forEach(item => {
|
21868
|
+
const itemRect = {
|
21869
|
+
x: item.x,
|
21870
|
+
y: item.y,
|
21871
|
+
width: item.desiredSize.width,
|
21872
|
+
height: item.desiredSize.height
|
21873
|
+
};
|
21874
|
+
item.arrange(e, itemRect);
|
21875
|
+
});
|
21876
|
+
return super.arrangeOverride(e, finalSize);
|
21877
|
+
}
|
21787
21878
|
}
|
21788
21879
|
|
21789
21880
|
/**
|
@@ -22071,5 +22162,5 @@ function removeDuplicatesEvent(events) {
|
|
22071
22162
|
return arr;
|
22072
22163
|
}
|
22073
22164
|
|
22074
|
-
export { BlockContainerElement, BlockContainerRenderObject, BlockContentElement, BlockContentRenderObject, BlockLineRectRenderObject, BodyPartProps, BooleanEnum, BorderProps, BranchElement, BranchRenderObject, BreakElement, BreakFactory, BreakRenderObject, CanvasTextEditor, CheckBoxElement, CheckBoxFactory, CheckBoxProps, CheckBoxRenderObject, ColumnPatchUtil, CommContentBaseElement, CommContentBaseRenderObject, CommContentElement, CommContentProps, CommContentRenderObject, CommProps, CommentContentFactory, CommentElement, CommentFactory, CommentRenderObject, CommentsFactory, CommentsUtil, CommonUtil, CommsContainerElement, CommsContainerRenderObject, ContentMenuItem, ContextMenuElementEvent, DOMEventSource, DOMSubscription, DataDecorateElement, DataDecorateProps, DataDecorateRenderObject, DataEleBaseProps, DataEleBaseTextProps, DataEleCheckProps, DataEleDateProps, DataEleImageProps, DataEleListProps, DataEleMHProps, DataElementBarcode, DataElementBarcodeFactory, DataElementBarcodeProps, DataElementBarcodeRenderObject, DataElementBaseFactory, DataElementCheck, DataElementCheckFactory, DataElementCheckRenderObject, DataElementDate, DataElementDateFactory, DataElementDateRenderObject, DataElementGroupElement, DataElementGroupFactory, DataElementGroupProps, DataElementGroupRenderObject, DataElementImage, DataElementImgFactory, DataElementInlineGroup, DataElementLeaf, DataElementList, DataElementListFactory, DataElementListRenderObject, DataElementMH, DataElementMHFactory, DataElementRenderObject, DataElementText, DataElementTextFactory, DataElementTextRenderObject, DataImageRenderObject, DataRenderMH, DocMode, DocumentBodyElement, DocumentBodyFactory, DocumentBodyPartElement, DocumentBodyPartFactory, DocumentBodyPartRenderObject, DocumentBodyRenderObject, DocumentChange, DocumentCombine, DocumentComment, DocumentContainerRender, DocumentContext, DocumentCursor, DocumentElement, DocumentEvalFunc, DocumentEvent, DocumentFactory, DocumentFooterElement, DocumentFooterFactory, DocumentFooterRenderObject, DocumentHeaderElement, DocumentHeaderFactory, DocumentHeaderRenderObject, DocumentImagesBaseLoader, DocumentImagesLoader, DocumentInput, DocumentPaint, DocumentPrintOffscreen, DocumentPrintOffscreenBase, DocumentProps, DocumentRenderObject, DocumentSelection, DocumentTemplate, DropElementEvent, EditMode, EditorContext, Element, ElementEvent, ElementFactory, ElementPaint, ElementReader, ElementSerialize, ElementUtil, EventMap, EventSourceCore$1 as EventSourceCore, FillNullSpaceElement, FillNullSpaceRenderObject, GetTrackTipsEvent, GotCursorEvent, IDispose, INotifyPropertyChanged, InlineBlockContainer, InlineGroupElement, InlineGroupInputElement, InlineGroupRenderObject, InlineMuiltBlockLineRenderObject, IsInSideDataElement, IsInSideInlineGroupInputElement, KeyboradElementEvent, LeafElement, LeafRenderObject, LostCursorEvent, MarginProps, ModifyFlag$1 as ModifyFlag, MouseElementEvent, MousedownElementEvent, MuiltBlockLineRenderObject, PSymbolElement, PSymbolRenderObject, PaddingProps, PageOptions, PaintContent, ParagraphElement, ParagraphFactory, ParagraphLineRectRenderObject, ParagraphNumberType, ParagraphProps, ParagraphRenderObject, PictureElement, PictureFactory, PictureProps, PictureRenderObject, RadioBoxElement, RadioBoxFactory, RadioBoxProps, RadioBoxRenderObject, RangeUtil, Rect, RenderContext, RenderObject, RenderObjectType, ResizeLeafRenderObject, RunElementFactory, SelectionOverlays, SelectionRange, SelectionState, Subject$1 as Subject, SubjectSubscription$1 as SubjectSubscription, Subscription$1 as Subscription, TableCellElement, TableCellFactory, TableCellProps, TableCellRenderObject, TableElement, TableFactory, TableProps, TableRenderObject, TableRowElement, TableRowFactory, TableRowProps, TableRowRenderObject, TableSplitCell, TableUtil, TextGroupElement, TextGroupFactory, TextGroupRenderObject, TextProps, TrackRunElement, TrackRunProps, TrackRunRenderObject, TrackRunTypeEnum, ValidateCondition, ValidateElement, ValidateProps, ValidateRenderObject, ViewOptions, createPrintTemplate, defaultParaHanging, deleteCurrentParagraph, documentPrint, elementTypeEventHandler, fontMapFunc, fromEvent, getFocusTextSegment, invokeTypeHandler, isDate, objectToString, onTableContextmenu, onceTask$1 as onceTask, printDocOnContextmenu, printNodes, reactiveMap, runTextLineRender, setDataElementProps, setNotifyChangedCallback, targetMaps, textLineRenderMode, toRawType, toTypeString, validateDataEle, validateDataEleRenderObj, validateInlineInputRenderObj, watchChanged };
|
22165
|
+
export { BlockContainerElement, BlockContainerRenderObject, BlockContentElement, BlockContentRenderObject, BlockLineRectRenderObject, BodyPartProps, BooleanEnum, BorderProps, BranchElement, BranchRenderObject, BreakElement, BreakFactory, BreakRenderObject, CanvasTextEditor, CheckBoxElement, CheckBoxFactory, CheckBoxProps, CheckBoxRenderObject, ColumnPatchUtil, CommContentBaseElement, CommContentBaseRenderObject, CommContentElement, CommContentProps, CommContentRenderObject, CommProps, CommentContentFactory, CommentElement, CommentFactory, CommentRenderObject, CommentsFactory, CommentsUtil, CommonUtil, CommsContainerElement, CommsContainerRenderObject, ContentMenuItem, ContextMenuElementEvent, DOMEventSource, DOMSubscription, DataDecorateElement, DataDecorateProps, DataDecorateRenderObject, DataEleBaseProps, DataEleBaseTextProps, DataEleCheckProps, DataEleDateProps, DataEleImageProps, DataEleListProps, DataEleMHProps, DataElementBarcode, DataElementBarcodeFactory, DataElementBarcodeProps, DataElementBarcodeRenderObject, DataElementBaseFactory, DataElementCheck, DataElementCheckFactory, DataElementCheckRenderObject, DataElementDate, DataElementDateFactory, DataElementDateRenderObject, DataElementGroupElement, DataElementGroupFactory, DataElementGroupProps, DataElementGroupRenderObject, DataElementImage, DataElementImgFactory, DataElementInlineGroup, DataElementLeaf, DataElementList, DataElementListFactory, DataElementListRenderObject, DataElementMH, DataElementMHFactory, DataElementRenderObject, DataElementText, DataElementTextFactory, DataElementTextRenderObject, DataImageRenderObject, DataRenderMH, DocMode, DocumentBodyElement, DocumentBodyFactory, DocumentBodyPartElement, DocumentBodyPartFactory, DocumentBodyPartRenderObject, DocumentBodyRenderObject, DocumentChange, DocumentCombine, DocumentComment, DocumentContainerRender, DocumentContext, DocumentCursor, DocumentElement, DocumentEvalFunc, DocumentEvent, DocumentFactory, DocumentFooterElement, DocumentFooterFactory, DocumentFooterRenderObject, DocumentHeaderElement, DocumentHeaderFactory, DocumentHeaderRenderObject, DocumentImagesBaseLoader, DocumentImagesLoader, DocumentInput, DocumentPaint, DocumentPrintOffscreen, DocumentPrintOffscreenBase, DocumentProps, DocumentRenderObject, DocumentSelection, DocumentTemplate, DropElementEvent, EditMode, EditorContext, Element, ElementEvent, ElementFactory, ElementPaint, ElementReader, ElementSerialize, ElementUtil, EventMap, EventSourceCore$1 as EventSourceCore, FillNullSpaceElement, FillNullSpaceRenderObject, GetTrackTipsEvent, GotCursorEvent, IDispose, INotifyPropertyChanged, InlineBlockContainer, InlineGroupElement, InlineGroupInputElement, InlineGroupRenderObject, InlineMuiltBlockLineRenderObject, IsInSideDataElement, IsInSideInlineGroupInputElement, KeyboradElementEvent, LeafElement, LeafRenderObject, LostCursorEvent, MarginProps, ModifyFlag$1 as ModifyFlag, MouseElementEvent, MousedownElementEvent, MuiltBlockLineRenderObject, OnceSubject, PSymbolElement, PSymbolRenderObject, PaddingProps, PageOptions, PaintContent, ParagraphElement, ParagraphFactory, ParagraphLineRectRenderObject, ParagraphNumberType, ParagraphProps, ParagraphRenderObject, PictureElement, PictureFactory, PictureProps, PictureRenderObject, RadioBoxElement, RadioBoxFactory, RadioBoxProps, RadioBoxRenderObject, RangeUtil, Rect, RenderContext, RenderObject, RenderObjectType, ResizeLeafRenderObject, RunElementFactory, SelectionOverlays, SelectionRange, SelectionState, Subject$1 as Subject, SubjectSubscription$1 as SubjectSubscription, Subscription$1 as Subscription, TableCellElement, TableCellFactory, TableCellProps, TableCellRenderObject, TableElement, TableFactory, TableProps, TableRenderObject, TableRowElement, TableRowFactory, TableRowProps, TableRowRenderObject, TableSplitCell, TableUtil, TextGroupElement, TextGroupFactory, TextGroupRenderObject, TextProps, TrackRunElement, TrackRunProps, TrackRunRenderObject, TrackRunTypeEnum, ValidateCondition, ValidateElement, ValidateProps, ValidateRenderObject, ViewOptions, createPrintTemplate, defaultParaHanging, deleteCurrentParagraph, documentPrint, elementTypeEventHandler, fontMapFunc, fromEvent, getFocusTextSegment, invokeTypeHandler, isDate, objectToString, onTableContextmenu, onceTask$1 as onceTask, printDocOnContextmenu, printNodes, reactiveMap, runTextLineRender, setDataElementProps, setNotifyChangedCallback, targetMaps, textLineRenderMode, toRawType, toTypeString, validateDataEle, validateDataEleRenderObj, validateInlineInputRenderObj, watchChanged };
|
22075
22166
|
//# sourceMappingURL=index.js.map
|