@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.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);
@@ -25711,11 +25747,13 @@ class EditorCalendarVNode {
25711
25747
  }
25712
25748
  render(position, dataValue) {
25713
25749
  if (!this.currentDate && dataValue) {
25714
- this.currYear.value = moment(dataValue).year();
25715
- this.currMonth.value = moment(dataValue).month();
25716
- this.selectedDate.value = moment(dataValue).format('YYYY-MM-DD');
25750
+ const currDataValue = moment(dataValue);
25751
+ this.currYear.value = currDataValue.year();
25752
+ this.currMonth.value = currDataValue.month();
25753
+ this.selectedDate.value = currDataValue.format('YYYY-MM-DD');
25717
25754
  this.currentDate = dataValue;
25718
- this.currTime.value = moment(dataValue).format('HH:mm:ss');
25755
+ this.currTime.value = currDataValue.format('HH:mm:ss');
25756
+ this.selectedTime.value = this.currTime.value;
25719
25757
  }
25720
25758
  if (!this.currentDate) {
25721
25759
  this.currentDate = moment().format('YYYY-MM-DD');
@@ -25911,7 +25949,7 @@ class EditorCalendarVNode {
25911
25949
  this.currYear.value = new Date().getFullYear();
25912
25950
  this.currMonth.value = new Date().getMonth();
25913
25951
  this.currCalendarMode.value = 'day';
25914
- this.selectedDate.value = null;
25952
+ this.selectedDate.value = moment().format('YYYY-MM-DD');
25915
25953
  }
25916
25954
  onClickDayYearPart() {
25917
25955
  this.currCalendarMode.value = 'year';
@@ -26602,7 +26640,7 @@ class DocEditor {
26602
26640
  children: [listVNode.render(), calendarFunc.render(), menuFunc.render()]
26603
26641
  };
26604
26642
  return {
26605
- sel: 'div#svg-container.svg-container',
26643
+ sel: 'div.svg-container',
26606
26644
  data: {
26607
26645
  style: {
26608
26646
  cursor: this.viewOptions.cursor