@hailin-zheng/editor-core 1.1.21 → 1.1.23
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/index-cjs.js +36 -23
- package/index-cjs.js.map +1 -1
- package/index.js +33 -20
- package/index.js.map +1 -1
- package/med_editor/framework/impl/text/text-impl.d.ts +1 -2
- package/med_editor/framework/render-context.d.ts +3 -3
- package/package.json +1 -1
- package/timeline/TimeValueGridControl.d.ts +1 -1
package/index-cjs.js
CHANGED
@@ -32,8 +32,8 @@ function _interopNamespace(e) {
|
|
32
32
|
|
33
33
|
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
34
34
|
var acor__namespace = /*#__PURE__*/_interopNamespace(acor);
|
35
|
-
var
|
36
|
-
var
|
35
|
+
var estraverse__default = /*#__PURE__*/_interopDefaultLegacy(estraverse);
|
36
|
+
var bwipjs__namespace = /*#__PURE__*/_interopNamespace(bwipjs);
|
37
37
|
var moment__default$1 = /*#__PURE__*/_interopDefaultLegacy(moment$1);
|
38
38
|
|
39
39
|
/**
|
@@ -2746,7 +2746,7 @@ class DataDecorateRenderObject extends LeafRenderObject {
|
|
2746
2746
|
|
2747
2747
|
function parser(code) {
|
2748
2748
|
const node = acor__namespace.parse(code, { ecmaVersion: 'latest' });
|
2749
|
-
|
2749
|
+
estraverse__default["default"].traverse(node, {
|
2750
2750
|
enter: (child, parent) => {
|
2751
2751
|
if (child.type === 'Identifier') {
|
2752
2752
|
const identifierName = child['name'];
|
@@ -2756,7 +2756,7 @@ function parser(code) {
|
|
2756
2756
|
}
|
2757
2757
|
}
|
2758
2758
|
});
|
2759
|
-
|
2759
|
+
estraverse__default["default"].replace(node, {
|
2760
2760
|
leave: (child) => {
|
2761
2761
|
//函数调用
|
2762
2762
|
if (child.type == 'CallExpression') {
|
@@ -4120,7 +4120,6 @@ class DocumentContainerRender extends BlockContainerRenderObject {
|
|
4120
4120
|
|
4121
4121
|
class TextGroupElement extends LeafElement {
|
4122
4122
|
textMeasures = [];
|
4123
|
-
fontBoundingBox;
|
4124
4123
|
isMeasure = false;
|
4125
4124
|
constructor() {
|
4126
4125
|
super('text');
|
@@ -4160,7 +4159,7 @@ class TextGroupElement extends LeafElement {
|
|
4160
4159
|
createRenderObject(data) {
|
4161
4160
|
if (!this.isMeasure || this.modifyFlag !== exports.ModifyFlag.None || !this.cacheRender) {
|
4162
4161
|
data.renderCtx.contentContext.measureTextUnits(this.textMeasures, this.props);
|
4163
|
-
|
4162
|
+
//data.renderCtx.contentContext.measureTextMetrics(this.props.getFont());
|
4164
4163
|
this.isMeasure = true;
|
4165
4164
|
}
|
4166
4165
|
const render = new TextGroupRenderObject(this);
|
@@ -4234,7 +4233,7 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
4234
4233
|
if (this.element.props.border) {
|
4235
4234
|
render.contentContext.strokeRect(position.x, position.y, this.rect.width, this.rect.height);
|
4236
4235
|
}
|
4237
|
-
render.contentContext.drawTextUnits(this, position.x, position.y
|
4236
|
+
render.contentContext.drawTextUnits(this, position.x, position.y + (this.rect.height - this.element.props.fontSize) / 2);
|
4238
4237
|
}
|
4239
4238
|
constructor(element) {
|
4240
4239
|
super(element);
|
@@ -4253,7 +4252,8 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
4253
4252
|
}
|
4254
4253
|
measure() {
|
4255
4254
|
this.rect.width = this.textMeasures.reduce((prev, curr) => prev + curr.actualSize, 0);
|
4256
|
-
this.rect.height = this.element.
|
4255
|
+
this.rect.height = Math.ceil(this.element.props.fontSize * 1.4);
|
4256
|
+
// this.element.fontBoundingBox.fontBoundingBoxAscent + this.element.fontBoundingBox.fontBoundingBoxDescent;
|
4257
4257
|
}
|
4258
4258
|
}
|
4259
4259
|
class TextGroupFactory extends ElementFactory {
|
@@ -4593,7 +4593,7 @@ class DocumentCursor {
|
|
4593
4593
|
if (['superscript', 'subscript'].indexOf(ele.props.vertAlign) >= 0) {
|
4594
4594
|
rect.height -= ele.props.fontSize / 2;
|
4595
4595
|
if (ele.props.vertAlign === 'subscript') {
|
4596
|
-
rect.y += rect.height;
|
4596
|
+
rect.y += rect.height * 2 / 5;
|
4597
4597
|
}
|
4598
4598
|
}
|
4599
4599
|
rect.x += horX;
|
@@ -7811,7 +7811,7 @@ class PaintContent {
|
|
7811
7811
|
this.init();
|
7812
7812
|
}
|
7813
7813
|
init() {
|
7814
|
-
this.ctx.textBaseline = '
|
7814
|
+
this.ctx.textBaseline = 'top';
|
7815
7815
|
}
|
7816
7816
|
setGlobalAlpha(alpha) {
|
7817
7817
|
this.ctx.globalAlpha = alpha;
|
@@ -7830,8 +7830,8 @@ class PaintContent {
|
|
7830
7830
|
this.ctx.save();
|
7831
7831
|
this.ctx.fillStyle = textProps.color;
|
7832
7832
|
this.ctx.font = textProps.getFont();
|
7833
|
-
const vertHeight = textProps.vertAlign === 'superscript' ? 0 : height;
|
7834
|
-
this.ctx.fillText(text, x, y + vertHeight
|
7833
|
+
const vertHeight = 0; // textProps.vertAlign === 'superscript' ? 0 : height;
|
7834
|
+
this.ctx.fillText(text, x, y + vertHeight);
|
7835
7835
|
this.ctx.restore();
|
7836
7836
|
if (textProps.linethrough) {
|
7837
7837
|
this.drawHoriLine(x, y + (Math.ceil(height / 2)), width, textProps.color, 1);
|
@@ -7851,7 +7851,7 @@ class PaintContent {
|
|
7851
7851
|
this.ctx.fill();
|
7852
7852
|
this.ctx.restore();
|
7853
7853
|
}
|
7854
|
-
drawTextUnits(textGroupRender, x, y
|
7854
|
+
drawTextUnits(textGroupRender, x, y) {
|
7855
7855
|
const textEle = textGroupRender.element;
|
7856
7856
|
const textProps = textEle.props;
|
7857
7857
|
const { width, height } = textGroupRender.rect;
|
@@ -7874,10 +7874,10 @@ class PaintContent {
|
|
7874
7874
|
this.drawHoriLine(x, y, width, textProps.color, 1);
|
7875
7875
|
}
|
7876
7876
|
let horX = 0;
|
7877
|
-
let vertHeight = baseLine;
|
7878
|
-
if (textProps.vertAlign === '
|
7877
|
+
let vertHeight = 0; //baseLine;
|
7878
|
+
if (textProps.vertAlign === 'subscript') {
|
7879
7879
|
//到top
|
7880
|
-
vertHeight
|
7880
|
+
vertHeight += textProps.fontSize * 2 / 5;
|
7881
7881
|
}
|
7882
7882
|
for (let i = 0; i < textGroupRender.textMeasures.length; i++) {
|
7883
7883
|
const unit = textGroupRender.textMeasures[i];
|
@@ -8618,7 +8618,7 @@ class DataElementBarcode extends DataElementLeaf {
|
|
8618
8618
|
if (!this.barCodeCanvas) {
|
8619
8619
|
this.barCodeCanvas = document.createElement('canvas');
|
8620
8620
|
}
|
8621
|
-
this.barCodeCanvas =
|
8621
|
+
this.barCodeCanvas = bwipjs__namespace.toCanvas(this.barCodeCanvas, {
|
8622
8622
|
bcid: this.props.type,
|
8623
8623
|
text: this.props.text || "0123456789",
|
8624
8624
|
height: 10,
|
@@ -11538,10 +11538,14 @@ class ParagraphMeasure {
|
|
11538
11538
|
setAlignJustify(render, count, spaceWidth) {
|
11539
11539
|
if (render instanceof BranchRenderObject) {
|
11540
11540
|
let width = 0;
|
11541
|
+
//累计元素的偏移量
|
11542
|
+
let offset = 0;
|
11541
11543
|
for (let i = 0; i < render.length; i++) {
|
11542
11544
|
const currRender = render.getChild(i);
|
11545
|
+
const currWidth = currRender.rect.width;
|
11543
11546
|
count += this.setAlignJustify(currRender, count, spaceWidth);
|
11544
|
-
currRender.rect.x +=
|
11547
|
+
currRender.rect.x += offset;
|
11548
|
+
offset += currRender.rect.width - currWidth;
|
11545
11549
|
width += currRender.rect.width;
|
11546
11550
|
}
|
11547
11551
|
render.rect.width = width;
|
@@ -19329,8 +19333,8 @@ class SurfaceView extends NodeItems {
|
|
19329
19333
|
class LabelNode extends TextBase {
|
19330
19334
|
constructor() {
|
19331
19335
|
super();
|
19332
|
-
this.border
|
19333
|
-
this.borderColor
|
19336
|
+
// this.border=1;
|
19337
|
+
// this.borderColor='#000';
|
19334
19338
|
}
|
19335
19339
|
_textWrapping = 'no';
|
19336
19340
|
get textWrapping() {
|
@@ -20681,7 +20685,7 @@ class TimelineControl extends AbsolutePanel {
|
|
20681
20685
|
}, 0);
|
20682
20686
|
return finalSize;
|
20683
20687
|
}
|
20684
|
-
|
20688
|
+
reBuild() {
|
20685
20689
|
treeForEach(this, item => {
|
20686
20690
|
if (item instanceof NodeItems) {
|
20687
20691
|
return item.controls;
|
@@ -20865,7 +20869,7 @@ class TimelineGridControl extends TimelineBaseControl {
|
|
20865
20869
|
value: this.randomNum(70, 150)
|
20866
20870
|
});
|
20867
20871
|
}
|
20868
|
-
this.eventData.push({ date: moment__default$1["default"](this.startTime).add(i, 'days').toDate(), value: '入\r\n
|
20872
|
+
this.eventData.push({ date: moment__default$1["default"](this.startTime).add(i, 'days').toDate(), value: '入\r\n院\r\n111' });
|
20869
20873
|
}
|
20870
20874
|
this.temperatureData.sort((prev, curr) => {
|
20871
20875
|
return curr.date > prev.date ? 1 : -1;
|
@@ -20873,6 +20877,10 @@ class TimelineGridControl extends TimelineBaseControl {
|
|
20873
20877
|
this.heartRateData.sort((prev, curr) => curr.date > prev.date ? 1 : -1);
|
20874
20878
|
}
|
20875
20879
|
buildOverride(e) {
|
20880
|
+
this.temperatureData.length = 0;
|
20881
|
+
this.heartRateData.length = 0;
|
20882
|
+
this.eventData.length = 0;
|
20883
|
+
this.init();
|
20876
20884
|
this.buildTemperature(e);
|
20877
20885
|
this.buildHearRate(e);
|
20878
20886
|
this.buildStampUnit(e);
|
@@ -21655,7 +21663,7 @@ function createTimeline() {
|
|
21655
21663
|
const timeGridContainer = new TimeGridContainer();
|
21656
21664
|
//timeGridContainer.y = 80;
|
21657
21665
|
const timelineGridControl = timeGridContainer.timelineGridControl; //new TimeLineControl();
|
21658
|
-
timelineGridControl.showDays =
|
21666
|
+
timelineGridControl.showDays = 100;
|
21659
21667
|
timelineGridControl.width = timelineGridControl.getLayoutWidth();
|
21660
21668
|
timelineGridControl.height = 300;
|
21661
21669
|
timelineGridControl.init();
|
@@ -22645,6 +22653,11 @@ class CanvasTextEditor extends AbsolutePanel {
|
|
22645
22653
|
surface.addChild(scrollView);
|
22646
22654
|
surface.addChild(rule2);
|
22647
22655
|
//surface.addChild(win);
|
22656
|
+
//
|
22657
|
+
// setInterval(()=>{
|
22658
|
+
// timeLineControl.reBuild();
|
22659
|
+
// this.onChanged();
|
22660
|
+
// },20)
|
22648
22661
|
surface.start();
|
22649
22662
|
}
|
22650
22663
|
/**
|