@zhongguo168a/yxeditor-common 0.0.22 → 0.0.24

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
@@ -1014,7 +1014,7 @@ declare class PageController extends Controller {
1014
1014
  enableHistory?: boolean;
1015
1015
  });
1016
1016
  open(...args: any[]): void;
1017
- close(): void;
1017
+ close(...args: any[]): void;
1018
1018
  protected onOpening(page: Page): void;
1019
1019
  protected onOpened(page: Page): void;
1020
1020
  protected onClosing(page: Page): void;
@@ -1879,6 +1879,16 @@ declare class StringUtil {
1879
1879
  * @param source
1880
1880
  */
1881
1881
  evalFormat(format: string, source: any): string;
1882
+ /**
1883
+ * 使用[separator]分割字符串,并替换掉在[index]位置的字符串
1884
+ * 如果没有发生变化,返回原来的值
1885
+ * @param val
1886
+ * @param separator
1887
+ * @param index
1888
+ * @param replace
1889
+ * @returns
1890
+ */
1891
+ replaceIndex(val: string, separator: string, index: number, replace?: string): string;
1882
1892
  splitIndex(val: string, separator: string, index: number, dflt?: string): string;
1883
1893
  splitFirst(val: string, separator: string, dflt?: string): string;
1884
1894
  splitLast(val: string, separator: string, dflt?: string): string;
package/dist/index.esm.js CHANGED
@@ -3789,10 +3789,10 @@ class PageRepo extends PageList {
3789
3789
  this._history = [];
3790
3790
  this._ctrlDict = new ControllerDict();
3791
3791
  this.onSet(this, (item) => {
3792
- this._indexRoute[item.route.path] = item;
3792
+ this._indexRoute[item.route.key] = item;
3793
3793
  });
3794
3794
  this.onDelete(this, (item) => {
3795
- delete this._indexRoute[item.route.path];
3795
+ delete this._indexRoute[item.route.key];
3796
3796
  });
3797
3797
  }
3798
3798
  openByString(route) {
@@ -3902,7 +3902,7 @@ class PageController extends Controller {
3902
3902
  }
3903
3903
  open(...args) {
3904
3904
  }
3905
- close() {
3905
+ close(...args) {
3906
3906
  }
3907
3907
  onOpening(page) {
3908
3908
  }
@@ -5927,6 +5927,23 @@ class StringUtil {
5927
5927
  }
5928
5928
  return result;
5929
5929
  }
5930
+ /**
5931
+ * 使用[separator]分割字符串,并替换掉在[index]位置的字符串
5932
+ * 如果没有发生变化,返回原来的值
5933
+ * @param val
5934
+ * @param separator
5935
+ * @param index
5936
+ * @param replace
5937
+ * @returns
5938
+ */
5939
+ replaceIndex(val, separator, index, replace = "") {
5940
+ let arr = val.split(separator);
5941
+ if (arr.length > index) {
5942
+ arr[index] = replace;
5943
+ return arr.join(separator);
5944
+ }
5945
+ return val;
5946
+ }
5930
5947
  splitIndex(val, separator, index, dflt = "") {
5931
5948
  let arr = val.split(separator);
5932
5949
  if (arr.length > index) {