@hailin-zheng/editor-core 2.0.12 → 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.js CHANGED
@@ -6497,7 +6497,7 @@ class TableRenderObject extends MuiltBlockLineRenderObject {
6497
6497
  if (prevVerticalLines) {
6498
6498
  for (let k = 0; k < currVerticalLines.length; k++) {
6499
6499
  const currVerticalLine = currVerticalLines[k];
6500
- const matchItem = prevVerticalLines.find(item => item.x === currVerticalLine.x);
6500
+ const matchItem = prevVerticalLines.find(item => item.x === currVerticalLine.x && currVerticalLine.y === item.y + item.height);
6501
6501
  if (matchItem) {
6502
6502
  matchItem.height += currVerticalLine.height;
6503
6503
  currVerticalLines[k] = matchItem;
@@ -10770,24 +10770,24 @@ class DataElementCheckRenderObject extends LeafRenderObject {
10770
10770
  let { width, height } = this.rect;
10771
10771
  width -= 4;
10772
10772
  t.children = [];
10773
- if (!props.drawStateChar || props.border) {
10774
- t.children.push({
10775
- sel: 'rect',
10776
- data: {
10777
- ns: "http://www.w3.org/2000/svg",
10778
- attrs: {
10779
- x: 2,
10780
- y: 0,
10781
- width,
10782
- height,
10783
- stroke: 'black',
10784
- fill: 'none',
10785
- 'stroke-width': 1
10786
- }
10787
- }
10788
- });
10789
- }
10790
10773
  if (props.drawStateChar) {
10774
+ if (props.border) {
10775
+ t.children.push({
10776
+ sel: 'rect',
10777
+ data: {
10778
+ ns: "http://www.w3.org/2000/svg",
10779
+ attrs: {
10780
+ x: 2,
10781
+ y: 0,
10782
+ width,
10783
+ height,
10784
+ stroke: 'black',
10785
+ fill: 'none',
10786
+ 'stroke-width': 1
10787
+ }
10788
+ }
10789
+ });
10790
+ }
10791
10791
  const str = props.checked ? props.trueChar : props.falseChar;
10792
10792
  t.children.push({
10793
10793
  sel: 'text',
@@ -10806,8 +10806,23 @@ class DataElementCheckRenderObject extends LeafRenderObject {
10806
10806
  });
10807
10807
  }
10808
10808
  else {
10809
- if (props.checked) {
10810
- if (props.multiSelect) {
10809
+ if (props.multiSelect) {
10810
+ t.children.push({
10811
+ sel: 'rect',
10812
+ data: {
10813
+ ns: "http://www.w3.org/2000/svg",
10814
+ attrs: {
10815
+ x: 2,
10816
+ y: 0,
10817
+ width,
10818
+ height,
10819
+ stroke: 'black',
10820
+ fill: 'none',
10821
+ 'stroke-width': 1
10822
+ }
10823
+ }
10824
+ });
10825
+ if (props.checked) {
10811
10826
  const paths = ElementUtil.getCheckboxPath(2, 0, props.size, props.size);
10812
10827
  t.children.push({
10813
10828
  sel: 'path',
@@ -10824,7 +10839,23 @@ class DataElementCheckRenderObject extends LeafRenderObject {
10824
10839
  }
10825
10840
  });
10826
10841
  }
10827
- else {
10842
+ }
10843
+ else {
10844
+ t.children.push({
10845
+ sel: 'circle',
10846
+ data: {
10847
+ ns: "http://www.w3.org/2000/svg",
10848
+ attrs: {
10849
+ cx: width / 2,
10850
+ cy: height / 2,
10851
+ r: width / 3,
10852
+ stroke: 'black',
10853
+ fill: 'none',
10854
+ 'stroke-width': 1
10855
+ }
10856
+ }
10857
+ });
10858
+ if (props.checked) {
10828
10859
  t.children.push({
10829
10860
  sel: 'circle',
10830
10861
  data: {
@@ -11426,6 +11457,9 @@ class DataElementText extends DataElementInlineGroup {
11426
11457
  }
11427
11458
  this.pubOnChange('self');
11428
11459
  this.clearInnerItems();
11460
+ if (typeof val !== 'string') {
11461
+ val += '';
11462
+ }
11429
11463
  if (val) {
11430
11464
  const items = val.split('<br/>');
11431
11465
  if (items.length) {
@@ -13546,9 +13580,11 @@ class DynamicContextParser {
13546
13580
  getControlById(id) {
13547
13581
  if (!this.cacheList) {
13548
13582
  const ctx = new DocumentContext(this.doc, this.ss);
13549
- this.cacheList = ctx.getControlInstanceList();
13583
+ this.cacheList = ctx.getDataElementModelList();
13550
13584
  }
13551
- return this.cacheList.find(item => item['props']['id'] === id);
13585
+ const f = this.cacheList.find(item => item.id === id);
13586
+ return f;
13587
+ //return this.cacheList.find(item => item['props']['id'] === id);
13552
13588
  }
13553
13589
  getObject(id) {
13554
13590
  new DocumentContext(this.doc, this.ss);
@@ -25913,7 +25949,7 @@ class EditorCalendarVNode {
25913
25949
  this.currYear.value = new Date().getFullYear();
25914
25950
  this.currMonth.value = new Date().getMonth();
25915
25951
  this.currCalendarMode.value = 'day';
25916
- this.selectedDate.value = null;
25952
+ this.selectedDate.value = moment().format('YYYY-MM-DD');
25917
25953
  }
25918
25954
  onClickDayYearPart() {
25919
25955
  this.currCalendarMode.value = 'year';
@@ -26604,7 +26640,7 @@ class DocEditor {
26604
26640
  children: [listVNode.render(), calendarFunc.render(), menuFunc.render()]
26605
26641
  };
26606
26642
  return {
26607
- sel: 'div#svg-container.svg-container',
26643
+ sel: 'div.svg-container',
26608
26644
  data: {
26609
26645
  style: {
26610
26646
  cursor: this.viewOptions.cursor