@hailin-zheng/editor-core 2.0.30 → 2.0.32

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
@@ -4912,6 +4912,9 @@ class DocumentSelection {
4912
4912
  * @private
4913
4913
  */
4914
4914
  updateSelectionState() {
4915
+ if (this.selectionState.startControl && !this.selectionState.startControl.parent) {
4916
+ this.selectionState.clear();
4917
+ }
4915
4918
  if (!this.selectionState.rangeDirty) {
4916
4919
  return false;
4917
4920
  }
@@ -8579,6 +8582,10 @@ class DataElementDate extends DataElementInlineGroup {
8579
8582
  return super.cloneSelf(data, DataElementDate);
8580
8583
  }
8581
8584
  setValue(val) {
8585
+ if (val === null) {
8586
+ this.clearInnerItems();
8587
+ return;
8588
+ }
8582
8589
  const format = this.props.format ?? 'YYYY-MM-DD';
8583
8590
  const date = moment(val, format);
8584
8591
  if (!date.isValid()) {
@@ -8941,6 +8948,10 @@ class DataElementList extends DataElementInlineGroup {
8941
8948
  return super.cloneSelf(data, DataElementList);
8942
8949
  }
8943
8950
  setValue(vals) {
8951
+ if (vals === null) {
8952
+ this.clearInnerItems();
8953
+ return;
8954
+ }
8944
8955
  if (!Array.isArray(vals)) {
8945
8956
  vals = [vals];
8946
8957
  }
@@ -27227,7 +27238,7 @@ class DocEditor {
27227
27238
  }
27228
27239
  getCursorRect() {
27229
27240
  try {
27230
- if (!this.documentEvent.startHitInfo) {
27241
+ if (!this.selectionState.editable) {
27231
27242
  return { x: 0, y: 0, width: 0, height: 0 };
27232
27243
  }
27233
27244
  const { startControl, startOffset } = this.selectionState;
@@ -27246,7 +27257,7 @@ class DocEditor {
27246
27257
  */
27247
27258
  setCursorVisibility(visibility) {
27248
27259
  if (visibility) {
27249
- this.editInput.style.removeProperty('display');
27260
+ //this.editInput.style.removeProperty('display');
27250
27261
  this.editInput.focus();
27251
27262
  }
27252
27263
  }
@@ -27255,7 +27266,7 @@ class DocEditor {
27255
27266
  this.editInput.style.left = pos ? pos.x + 'px' : '-2px';
27256
27267
  this.editInput.style.top = pos ? pos.y + 'px' : '-2px';
27257
27268
  this.editInput.readOnly = true;
27258
- this.editInput.style.display = 'none';
27269
+ //this.editInput.style.display = 'none';
27259
27270
  !reset && this.editInput.focus();
27260
27271
  }
27261
27272
  /**