@mediusinc/mng-commons 7.0.0 → 7.0.1-rc.0

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.
@@ -2242,7 +2242,7 @@ class ParametrizePipe {
2242
2242
  constructor() {
2243
2243
  this.jsonPath = new JsonPathPipe();
2244
2244
  }
2245
- transform(value, itemId, item, data, opts) {
2245
+ transform(value, itemId, item, data) {
2246
2246
  let params = {};
2247
2247
  if (data) {
2248
2248
  params = {
@@ -2263,10 +2263,10 @@ class ParametrizePipe {
2263
2263
  };
2264
2264
  }
2265
2265
  if (typeof value === 'string') {
2266
- return this.transformString(value, params, opts);
2266
+ return this.transformString(value, params);
2267
2267
  }
2268
2268
  else if (Array.isArray(value) && value.length > 0 && typeof value[0] === 'string') {
2269
- return value.map((s) => this.transformString(s, params, opts));
2269
+ return value.map((s) => this.transformString(s, params));
2270
2270
  }
2271
2271
  else if (typeof value === 'object') {
2272
2272
  // process only first level citizens
@@ -2274,7 +2274,7 @@ class ParametrizePipe {
2274
2274
  for (const key in obj) {
2275
2275
  const objProp = obj[key];
2276
2276
  if (typeof objProp === 'string') {
2277
- obj[key] = this.transformString(objProp, params, opts);
2277
+ obj[key] = this.transformString(objProp, params);
2278
2278
  }
2279
2279
  }
2280
2280
  return obj;
@@ -2283,7 +2283,7 @@ class ParametrizePipe {
2283
2283
  return value;
2284
2284
  }
2285
2285
  }
2286
- transformString(s, params, opts) {
2286
+ transformString(s, params) {
2287
2287
  if ((s.indexOf('/') >= 0 && s.indexOf(':') >= 0 && !s.startsWith('http://') && !s.startsWith('https://')) || s.startsWith(':')) {
2288
2288
  // this is router link
2289
2289
  return s
@@ -2293,26 +2293,20 @@ class ParametrizePipe {
2293
2293
  }
2294
2294
  else {
2295
2295
  // parametrize normally
2296
- return this.parametrizeString(s, params, opts);
2296
+ return this.parametrizeString(s, params);
2297
2297
  }
2298
2298
  }
2299
2299
  parametrizeStringAsRouterLink(s, params) {
2300
2300
  if (s.startsWith(':')) {
2301
2301
  const itemProperty = s.substring(1);
2302
- return encodeURIComponent(this.jsonPath.transform(params, itemProperty) ?? '');
2302
+ return this.jsonPath.transform(params, itemProperty) ?? '';
2303
2303
  }
2304
2304
  else {
2305
2305
  return s;
2306
2306
  }
2307
2307
  }
2308
- parametrizeString(s, params, opts) {
2309
- return s.replace(/{{\s?([^{}\s]*)\s?}}/g, (subs, key) => {
2310
- let value = this.jsonPath.transform(params, key);
2311
- if (value != null && opts?.encodeParams) {
2312
- value = encodeURIComponent(value);
2313
- }
2314
- return value ?? subs;
2315
- });
2308
+ parametrizeString(s, params) {
2309
+ return s.replace(/{{\s?([^{}\s]*)\s?}}/g, (subs, key) => this.jsonPath.transform(params, key) ?? subs);
2316
2310
  }
2317
2311
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ParametrizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2318
2312
  static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: ParametrizePipe, isStandalone: true, name: "mngParametrize" }); }