@zhongguo168a/yxeditor-common 0.0.152 → 0.0.154

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/dist/index.d.ts CHANGED
@@ -726,7 +726,7 @@ declare class Dictionary<K = string, V = any> {
726
726
  * 克隆自身所有项到【target】对象,并返回【target】对象
727
727
  * @param target
728
728
  */
729
- clone(target: Dictionary<K, V>): Dictionary<K, V>;
729
+ clone(target?: Dictionary<K, V>): Dictionary<K, V>;
730
730
  resetByDict(dict: Dictionary<K, V>): void;
731
731
  onSet(caller: any, handler: (key: K, value: V) => void): void;
732
732
  onDelete(caller: any, handler: (key: K, value: V) => void): void;
package/dist/index.esm.js CHANGED
@@ -2884,6 +2884,9 @@ class Dictionary {
2884
2884
  * @param target
2885
2885
  */
2886
2886
  clone(target) {
2887
+ if (!target) {
2888
+ target = new Dictionary();
2889
+ }
2887
2890
  for (const key in this._data) {
2888
2891
  let item = this._data[key];
2889
2892
  // @ts-ignore
@@ -4454,20 +4457,17 @@ class ViewModel extends EventDispatcher {
4454
4457
  * 如果返回 null,表示主动取消 [cancel]
4455
4458
  */
4456
4459
  wait() {
4457
- this._result = false;
4458
4460
  switch (this.state) {
4459
4461
  case ViewState.Opening:
4460
4462
  return new Promise((resolve, reject) => {
4461
4463
  let opened = () => {
4462
4464
  this.off("opened", this, opened);
4463
4465
  this.off("closed", this, opened);
4464
- this._result = true;
4465
4466
  resolve(this);
4466
4467
  };
4467
4468
  let canceled = () => {
4468
4469
  this.off("opened", this, opened);
4469
4470
  this.off("closed", this, opened);
4470
- this._result = false;
4471
4471
  resolve(this);
4472
4472
  };
4473
4473
  this.on("opened", this, opened);
@@ -4477,14 +4477,12 @@ class ViewModel extends EventDispatcher {
4477
4477
  return new Promise((resolve, reject) => {
4478
4478
  let opened = () => {
4479
4479
  this.off("closed", this, opened);
4480
- this._result = true;
4481
4480
  resolve(this);
4482
4481
  };
4483
4482
  this.on("closed", this, opened);
4484
4483
  });
4485
4484
  default:
4486
4485
  return new Promise((resolve, reject) => {
4487
- this._result = true;
4488
4486
  resolve(this);
4489
4487
  });
4490
4488
  }