@wavemaker/angular-codegen 11.5.1-rc.5410 → 11.5.1-rc.5414

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.
@@ -36,7 +36,7 @@
36
36
  "@metrichor/jmespath": "^0.3.1",
37
37
  "@wavemaker.com/nvd3": "1.0.0",
38
38
  "@wavemaker/focus-trap": "^1.0.0",
39
- "@wavemaker/variables": "11.5.1-rc.5410",
39
+ "@wavemaker/variables": "11.5.1-rc.5414",
40
40
  "@ztree/ztree_v3": "^3.5.48",
41
41
  "angular-imask": "6.3.0",
42
42
  "angular2-websocket": "0.9.7",
@@ -5947,9 +5947,9 @@
5947
5947
  }
5948
5948
  },
5949
5949
  "node_modules/@wavemaker/variables": {
5950
- "version": "11.5.1-rc.5410",
5951
- "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-11.5.1-rc.5410.tgz",
5952
- "integrity": "sha512-qb0sphfGun5pJ0wltm1XTeQSeoiIT9Qy0KcpVM+MN1eE0+F5RHBem0+Fvap4s8f7RLhbNuNv6S5aprGNDGuymQ==",
5950
+ "version": "11.5.1-rc.5414",
5951
+ "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-11.5.1-rc.5414.tgz",
5952
+ "integrity": "sha512-qj8gvW9bFWLGroEcOnUCST74kidMNNlTAElr5Q83d4rIvCwbKJhh+FYMM4uJwBodk4IqfpI0BiKG97pNRak+wQ==",
5953
5953
  "dependencies": {
5954
5954
  "@metrichor/jmespath": "^0.3.1",
5955
5955
  "he": "^1.2.0",
@@ -47,7 +47,7 @@
47
47
  "@metrichor/jmespath": "^0.3.1",
48
48
  "@wavemaker.com/nvd3": "1.0.0",
49
49
  "@wavemaker/focus-trap": "^1.0.0",
50
- "@wavemaker/variables": "11.5.1-rc.5410",
50
+ "@wavemaker/variables": "11.5.1-rc.5414",
51
51
  "@ztree/ztree_v3": "^3.5.48",
52
52
  "angular-imask": "6.3.0",
53
53
  "angular2-websocket": "0.9.7",
@@ -72,7 +72,7 @@
72
72
  "tslib": "2.4.1",
73
73
  "x2js": "^3.4.4",
74
74
  "zone.js": "~0.11.4",
75
- "@wavemaker/app-ng-runtime": "11.5.1-rc.5410"
75
+ "@wavemaker/app-ng-runtime": "11.5.1-rc.5414"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
@@ -96668,6 +96668,23 @@ CoreModule$1.ɵinj = /*@__PURE__*/ ɵɵdefineInjector({ imports: [HttpClientModu
96668
96668
  }], null, null); })();
96669
96669
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(CoreModule$1, { imports: [HttpClientModule$1] }); })();
96670
96670
 
96671
+ class WmPipe {
96672
+ constructor(pipeName, customPipeManager) {
96673
+ this.pipeName = pipeName;
96674
+ this.customPipeManager = customPipeManager;
96675
+ this.pipeRef = this.customPipeManager ? this.customPipeManager.getCustomPipe(pipeName) : null;
96676
+ this.isCustomPipe = this.pipeRef && _.isFunction(this.pipeRef.formatter);
96677
+ }
96678
+ customFormatter(data, args) {
96679
+ try {
96680
+ return this.pipeRef.formatter(...args);
96681
+ }
96682
+ catch (error) {
96683
+ return data;
96684
+ }
96685
+ }
96686
+ }
96687
+
96671
96688
  const getEpochValue = data => {
96672
96689
  let epoch;
96673
96690
  // For data in form of string number ('123'), convert to number (123). And don't parse date objects.
@@ -96696,23 +96713,33 @@ TrailingZeroDecimalPipe.ɵpipe = /*@__PURE__*/ ɵɵdefinePipe({ name: "trailingZ
96696
96713
  name: 'trailingZeroDecimalPipe'
96697
96714
  }]
96698
96715
  }], function () { return [{ type: DecimalPipe }]; }, null); })();
96699
- class ToDatePipe {
96716
+ class ToDatePipe extends WmPipe {
96717
+ // This method calls the custom formatter fn after applying the exisitng date pattern
96718
+ returnFn(data, args) {
96719
+ if (this.isCustomPipe) {
96720
+ if (args) {
96721
+ args[0] = data;
96722
+ }
96723
+ return this.customFormatter(data, args);
96724
+ }
96725
+ return data;
96726
+ }
96700
96727
  transform(data, format, timezone, compInstance) {
96701
96728
  let timestamp;
96702
96729
  // 'null' is to be treated as a special case, If user wants to enter null value, empty string will be passed to the backend
96703
96730
  if (data === 'null' || data === '') {
96704
- return '';
96731
+ return this.returnFn('', arguments);
96705
96732
  }
96706
96733
  if (!isDefined$1(data)) {
96707
- return '';
96734
+ return this.returnFn('', arguments);
96708
96735
  }
96709
96736
  timestamp = getEpochValue(data);
96710
96737
  if (timestamp) {
96711
96738
  if (format === 'timestamp') {
96712
- return timestamp;
96739
+ return this.returnFn(timestamp, arguments);
96713
96740
  }
96714
96741
  if (format === 'UTC') {
96715
- return new Date(timestamp).toISOString();
96742
+ return this.returnFn(new Date(timestamp).toISOString(), arguments);
96716
96743
  }
96717
96744
  let formattedVal;
96718
96745
  const timeZone = this.i18nService ? this.i18nService.getTimezone(compInstance) : timezone;
@@ -96722,23 +96749,25 @@ class ToDatePipe {
96722
96749
  else {
96723
96750
  formattedVal = this.datePipe.transform(timestamp, format);
96724
96751
  }
96725
- return formattedVal;
96752
+ return this.returnFn(formattedVal, arguments);
96726
96753
  }
96727
- return '';
96754
+ return this.returnFn('', arguments);
96728
96755
  }
96729
- constructor(datePipe, i18nService) {
96756
+ constructor(datePipe, i18nService, customPipeManager) {
96757
+ super('toDate', customPipeManager);
96730
96758
  this.datePipe = datePipe;
96731
96759
  this.i18nService = i18nService;
96760
+ this.customPipeManager = customPipeManager;
96732
96761
  }
96733
96762
  }
96734
- ToDatePipe.ɵfac = function ToDatePipe_Factory(t) { return new (t || ToDatePipe)(ɵɵdirectiveInject(DatePipe, 16), ɵɵdirectiveInject(AbstractI18nService$1, 16)); };
96763
+ ToDatePipe.ɵfac = function ToDatePipe_Factory(t) { return new (t || ToDatePipe)(ɵɵdirectiveInject(DatePipe, 16), ɵɵdirectiveInject(AbstractI18nService$1, 16), ɵɵdirectiveInject(CustomPipeManager$1, 16)); };
96735
96764
  ToDatePipe.ɵpipe = /*@__PURE__*/ ɵɵdefinePipe({ name: "toDate", type: ToDatePipe, pure: true });
96736
96765
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ToDatePipe, [{
96737
96766
  type: Pipe,
96738
96767
  args: [{
96739
96768
  name: 'toDate'
96740
96769
  }]
96741
- }], function () { return [{ type: DatePipe }, { type: AbstractI18nService$1 }]; }, null); })();
96770
+ }], function () { return [{ type: DatePipe }, { type: AbstractI18nService$1 }, { type: CustomPipeManager$1 }]; }, null); })();
96742
96771
  class ToNumberPipe {
96743
96772
  transform(data, fracSize) {
96744
96773
  if (fracSize && !String(fracSize).match(/^(\d+)?\.((\d+)(-(\d+))?)?$/)) {
@@ -125304,7 +125333,7 @@ class PipeProvider {
125304
125333
  this.preparePipeMeta(CurrencyPipe$1, 'currency', true, [this._locale]),
125305
125334
  this.preparePipeMeta(DatePipe$1, 'date', true, [this._locale]),
125306
125335
  this.preparePipeMeta(ToDatePipe, 'toDate', true, [
125307
- new DatePipe$1(this._locale)
125336
+ new DatePipe$1(this._locale), undefined, this.injector.get(CustomPipeManager)
125308
125337
  ]),
125309
125338
  this.preparePipeMeta(ToNumberPipe, 'toNumber', true, [
125310
125339
  new DecimalPipe$1(this._locale),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-codegen",
3
- "version": "11.5.1-rc.5410",
3
+ "version": "11.5.1-rc.5414",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {