@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-cjs.js CHANGED
@@ -4942,6 +4942,9 @@ class DocumentSelection {
4942
4942
  * @private
4943
4943
  */
4944
4944
  updateSelectionState() {
4945
+ if (this.selectionState.startControl && !this.selectionState.startControl.parent) {
4946
+ this.selectionState.clear();
4947
+ }
4945
4948
  if (!this.selectionState.rangeDirty) {
4946
4949
  return false;
4947
4950
  }
@@ -8609,6 +8612,10 @@ class DataElementDate extends DataElementInlineGroup {
8609
8612
  return super.cloneSelf(data, DataElementDate);
8610
8613
  }
8611
8614
  setValue(val) {
8615
+ if (val === null) {
8616
+ this.clearInnerItems();
8617
+ return;
8618
+ }
8612
8619
  const format = this.props.format ?? 'YYYY-MM-DD';
8613
8620
  const date = moment__default["default"](val, format);
8614
8621
  if (!date.isValid()) {
@@ -8971,6 +8978,10 @@ class DataElementList extends DataElementInlineGroup {
8971
8978
  return super.cloneSelf(data, DataElementList);
8972
8979
  }
8973
8980
  setValue(vals) {
8981
+ if (vals === null) {
8982
+ this.clearInnerItems();
8983
+ return;
8984
+ }
8974
8985
  if (!Array.isArray(vals)) {
8975
8986
  vals = [vals];
8976
8987
  }
@@ -27257,7 +27268,7 @@ class DocEditor {
27257
27268
  }
27258
27269
  getCursorRect() {
27259
27270
  try {
27260
- if (!this.documentEvent.startHitInfo) {
27271
+ if (!this.selectionState.editable) {
27261
27272
  return { x: 0, y: 0, width: 0, height: 0 };
27262
27273
  }
27263
27274
  const { startControl, startOffset } = this.selectionState;
@@ -27276,7 +27287,7 @@ class DocEditor {
27276
27287
  */
27277
27288
  setCursorVisibility(visibility) {
27278
27289
  if (visibility) {
27279
- this.editInput.style.removeProperty('display');
27290
+ //this.editInput.style.removeProperty('display');
27280
27291
  this.editInput.focus();
27281
27292
  }
27282
27293
  }
@@ -27285,7 +27296,7 @@ class DocEditor {
27285
27296
  this.editInput.style.left = pos ? pos.x + 'px' : '-2px';
27286
27297
  this.editInput.style.top = pos ? pos.y + 'px' : '-2px';
27287
27298
  this.editInput.readOnly = true;
27288
- this.editInput.style.display = 'none';
27299
+ //this.editInput.style.display = 'none';
27289
27300
  !reset && this.editInput.focus();
27290
27301
  }
27291
27302
  /**