@zhongguo168a/yxeditor-common 0.0.107 → 0.0.109

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
@@ -827,8 +827,10 @@ declare class DictSource extends Dictionary<string, DictNode> {
827
827
  }
828
828
 
829
829
  declare class ListIterator {
830
- break(): void;
830
+ break(reason?: any): void;
831
831
  isBreak(): boolean;
832
+ getReason(): any;
833
+ protected _reason: any;
832
834
  protected _isBreak: any;
833
835
  }
834
836
  declare class List<T = any> {
@@ -843,7 +845,7 @@ declare class List<T = any> {
843
845
  * @param cond 可以使用【iterator】中断遍历
844
846
  * @param removedList 设置后,可获得被移除的项
845
847
  */
846
- removeByCondition(cond: (index: number, val: T, iterator: ListIterator) => boolean, removedList?: List): this;
848
+ removeByCondition(cond: (index: number, val: T, iterator: ListIterator) => boolean, removedList?: List<T>): ListIterator;
847
849
  /**
848
850
  * 查找符合条件的项保存到【target】对象中,并返回【target】对象
849
851
  * @param cond 可以使用【iterator】中断遍历
package/dist/index.esm.js CHANGED
@@ -2863,11 +2863,11 @@ class Dictionary {
2863
2863
  * 如果使用了 onSet or onDelete,需要注意清理
2864
2864
  */
2865
2865
  clear(useIter = true) {
2866
- let data = this._data;
2866
+ this._data;
2867
2867
  if (useIter) {
2868
- for (const key in data) {
2869
- const item = data[key];
2870
- this.delete(item);
2868
+ let keys = this.keys();
2869
+ for (const key of keys) {
2870
+ this.delete(key);
2871
2871
  }
2872
2872
  }
2873
2873
  else {
@@ -3208,12 +3208,16 @@ DictSource.EVENT_REFRESH = "refresh";
3208
3208
  DictSource.EVENT_TAGS_SET = "tags_set";
3209
3209
 
3210
3210
  class ListIterator {
3211
- break() {
3211
+ break(reason) {
3212
3212
  this._isBreak = true;
3213
+ this._reason = reason;
3213
3214
  }
3214
3215
  isBreak() {
3215
3216
  return this._isBreak;
3216
3217
  }
3218
+ getReason() {
3219
+ return this._reason;
3220
+ }
3217
3221
  }
3218
3222
  class List {
3219
3223
  constructor() {
@@ -3259,6 +3263,7 @@ class List {
3259
3263
  return iterator;
3260
3264
  }
3261
3265
  }
3266
+ return iterator;
3262
3267
  }
3263
3268
  /**
3264
3269
  * 移除符合条件的项, 从后往前遍历
@@ -3280,7 +3285,7 @@ class List {
3280
3285
  break;
3281
3286
  }
3282
3287
  }
3283
- return removedList;
3288
+ return iterator;
3284
3289
  }
3285
3290
  /**
3286
3291
  * 查找符合条件的项保存到【target】对象中,并返回【target】对象