@hailin-zheng/editor-core 2.0.11 → 2.0.13

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 CHANGED
@@ -6527,7 +6527,7 @@ class TableRenderObject extends MuiltBlockLineRenderObject {
6527
6527
  if (prevVerticalLines) {
6528
6528
  for (let k = 0; k < currVerticalLines.length; k++) {
6529
6529
  const currVerticalLine = currVerticalLines[k];
6530
- const matchItem = prevVerticalLines.find(item => item.x === currVerticalLine.x);
6530
+ const matchItem = prevVerticalLines.find(item => item.x === currVerticalLine.x && currVerticalLine.y === item.y + item.height);
6531
6531
  if (matchItem) {
6532
6532
  matchItem.height += currVerticalLine.height;
6533
6533
  currVerticalLines[k] = matchItem;
@@ -10800,24 +10800,24 @@ class DataElementCheckRenderObject extends LeafRenderObject {
10800
10800
  let { width, height } = this.rect;
10801
10801
  width -= 4;
10802
10802
  t.children = [];
10803
- if (!props.drawStateChar || props.border) {
10804
- t.children.push({
10805
- sel: 'rect',
10806
- data: {
10807
- ns: "http://www.w3.org/2000/svg",
10808
- attrs: {
10809
- x: 2,
10810
- y: 0,
10811
- width,
10812
- height,
10813
- stroke: 'black',
10814
- fill: 'none',
10815
- 'stroke-width': 1
10816
- }
10817
- }
10818
- });
10819
- }
10820
10803
  if (props.drawStateChar) {
10804
+ if (props.border) {
10805
+ t.children.push({
10806
+ sel: 'rect',
10807
+ data: {
10808
+ ns: "http://www.w3.org/2000/svg",
10809
+ attrs: {
10810
+ x: 2,
10811
+ y: 0,
10812
+ width,
10813
+ height,
10814
+ stroke: 'black',
10815
+ fill: 'none',
10816
+ 'stroke-width': 1
10817
+ }
10818
+ }
10819
+ });
10820
+ }
10821
10821
  const str = props.checked ? props.trueChar : props.falseChar;
10822
10822
  t.children.push({
10823
10823
  sel: 'text',
@@ -10836,8 +10836,23 @@ class DataElementCheckRenderObject extends LeafRenderObject {
10836
10836
  });
10837
10837
  }
10838
10838
  else {
10839
- if (props.checked) {
10840
- if (props.multiSelect) {
10839
+ if (props.multiSelect) {
10840
+ t.children.push({
10841
+ sel: 'rect',
10842
+ data: {
10843
+ ns: "http://www.w3.org/2000/svg",
10844
+ attrs: {
10845
+ x: 2,
10846
+ y: 0,
10847
+ width,
10848
+ height,
10849
+ stroke: 'black',
10850
+ fill: 'none',
10851
+ 'stroke-width': 1
10852
+ }
10853
+ }
10854
+ });
10855
+ if (props.checked) {
10841
10856
  const paths = ElementUtil.getCheckboxPath(2, 0, props.size, props.size);
10842
10857
  t.children.push({
10843
10858
  sel: 'path',
@@ -10854,7 +10869,23 @@ class DataElementCheckRenderObject extends LeafRenderObject {
10854
10869
  }
10855
10870
  });
10856
10871
  }
10857
- else {
10872
+ }
10873
+ else {
10874
+ t.children.push({
10875
+ sel: 'circle',
10876
+ data: {
10877
+ ns: "http://www.w3.org/2000/svg",
10878
+ attrs: {
10879
+ cx: width / 2,
10880
+ cy: height / 2,
10881
+ r: width / 3,
10882
+ stroke: 'black',
10883
+ fill: 'none',
10884
+ 'stroke-width': 1
10885
+ }
10886
+ }
10887
+ });
10888
+ if (props.checked) {
10858
10889
  t.children.push({
10859
10890
  sel: 'circle',
10860
10891
  data: {
@@ -11456,6 +11487,9 @@ class DataElementText extends DataElementInlineGroup {
11456
11487
  }
11457
11488
  this.pubOnChange('self');
11458
11489
  this.clearInnerItems();
11490
+ if (typeof val !== 'string') {
11491
+ val += '';
11492
+ }
11459
11493
  if (val) {
11460
11494
  const items = val.split('<br/>');
11461
11495
  if (items.length) {
@@ -13576,9 +13610,11 @@ class DynamicContextParser {
13576
13610
  getControlById(id) {
13577
13611
  if (!this.cacheList) {
13578
13612
  const ctx = new DocumentContext(this.doc, this.ss);
13579
- this.cacheList = ctx.getControlInstanceList();
13613
+ this.cacheList = ctx.getDataElementModelList();
13580
13614
  }
13581
- return this.cacheList.find(item => item['props']['id'] === id);
13615
+ const f = this.cacheList.find(item => item.id === id);
13616
+ return f;
13617
+ //return this.cacheList.find(item => item['props']['id'] === id);
13582
13618
  }
13583
13619
  getObject(id) {
13584
13620
  new DocumentContext(this.doc, this.ss);
@@ -25741,11 +25777,13 @@ class EditorCalendarVNode {
25741
25777
  }
25742
25778
  render(position, dataValue) {
25743
25779
  if (!this.currentDate && dataValue) {
25744
- this.currYear.value = moment__default["default"](dataValue).year();
25745
- this.currMonth.value = moment__default["default"](dataValue).month();
25746
- this.selectedDate.value = moment__default["default"](dataValue).format('YYYY-MM-DD');
25780
+ const currDataValue = moment__default["default"](dataValue);
25781
+ this.currYear.value = currDataValue.year();
25782
+ this.currMonth.value = currDataValue.month();
25783
+ this.selectedDate.value = currDataValue.format('YYYY-MM-DD');
25747
25784
  this.currentDate = dataValue;
25748
- this.currTime.value = moment__default["default"](dataValue).format('HH:mm:ss');
25785
+ this.currTime.value = currDataValue.format('HH:mm:ss');
25786
+ this.selectedTime.value = this.currTime.value;
25749
25787
  }
25750
25788
  if (!this.currentDate) {
25751
25789
  this.currentDate = moment__default["default"]().format('YYYY-MM-DD');
@@ -25941,7 +25979,7 @@ class EditorCalendarVNode {
25941
25979
  this.currYear.value = new Date().getFullYear();
25942
25980
  this.currMonth.value = new Date().getMonth();
25943
25981
  this.currCalendarMode.value = 'day';
25944
- this.selectedDate.value = null;
25982
+ this.selectedDate.value = moment__default["default"]().format('YYYY-MM-DD');
25945
25983
  }
25946
25984
  onClickDayYearPart() {
25947
25985
  this.currCalendarMode.value = 'year';
@@ -26632,7 +26670,7 @@ class DocEditor {
26632
26670
  children: [listVNode.render(), calendarFunc.render(), menuFunc.render()]
26633
26671
  };
26634
26672
  return {
26635
- sel: 'div#svg-container.svg-container',
26673
+ sel: 'div.svg-container',
26636
26674
  data: {
26637
26675
  style: {
26638
26676
  cursor: this.viewOptions.cursor