@wavemaker/app-runtime-wm-build 11.4.2-rc.5376 → 11.4.2-rc.5379

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.
@@ -4168,7 +4168,7 @@
4168
4168
  EXCLUDEDAYS: "excludedays"
4169
4169
  };
4170
4170
  var transformFileURI = function(url) {
4171
- if (url && hasCordova() && url.startsWith("file://")) {
4171
+ if (_.isString(url) && hasCordova() && url.startsWith("file://")) {
4172
4172
  if (isIos()) {
4173
4173
  return url.replace("file://", "/_app_file_");
4174
4174
  } else if (isAndroid() && location.href.startsWith("http")) {
@@ -17281,6 +17281,9 @@
17281
17281
  core$1.$appDigest();
17282
17282
  }), 150);
17283
17283
  _this.handleHeaderClick = core$1.noop;
17284
+ _this.cancelLocaleChangeSubscription = _this.getAppInstance().subscribe("locale-changed", (function() {
17285
+ _this._debouncedInitDatasetItems();
17286
+ }));
17284
17287
  return _this;
17285
17288
  }
17286
17289
  Object.defineProperty(DatasetAwareFormComponent.prototype, "modelByKey", {
@@ -17493,6 +17496,11 @@
17493
17496
  this.toggleAllHeaders = base.toggleAllHeaders.bind(undefined, this);
17494
17497
  }
17495
17498
  };
17499
+ DatasetAwareFormComponent.prototype.ngOnDestroy = function() {
17500
+ if (this.cancelLocaleChangeSubscription) {
17501
+ this.cancelLocaleChangeSubscription();
17502
+ }
17503
+ };
17496
17504
  return DatasetAwareFormComponent;
17497
17505
  }(BaseFormCustomComponent);
17498
17506
  DatasetAwareFormComponent.decorators = [ {
@@ -24046,6 +24054,11 @@
24046
24054
  i18nService.initCalendarLocale();
24047
24055
  FullCalendar.__wm_locale_initialized = true;
24048
24056
  }
24057
+ _this.cancelLocaleChangeSubscription = _this.getAppInstance().subscribe("locale-changed", (function(libLocale) {
24058
+ _this.setLocale();
24059
+ _this.applyCalendarOptions("option", "locale", libLocale.fullCalendar || "en");
24060
+ _this.redraw();
24061
+ }));
24049
24062
  return _this;
24050
24063
  }
24051
24064
  CalendarComponent.prototype.selectDate = function() {
@@ -24508,6 +24521,11 @@
24508
24521
  }));
24509
24522
  }));
24510
24523
  };
24524
+ CalendarComponent.prototype.ngOnDestroy = function() {
24525
+ if (this.cancelLocaleChangeSubscription) {
24526
+ this.cancelLocaleChangeSubscription();
24527
+ }
24528
+ };
24511
24529
  return CalendarComponent;
24512
24530
  }(base.StylableComponent);
24513
24531
  CalendarComponent.initializeProps = registerProps();
@@ -27095,7 +27113,7 @@
27095
27113
  type: core.Component,
27096
27114
  args: [ {
27097
27115
  selector: "wm-datetimepicker",
27098
- template: ' \n <ng-template #datetimepickerTemplate>\n <div class="app-datetime-picker">\n <div class="modal-body">\n <div class="mobile-datetime-picker-options">\n \n </div>\n <bs-datepicker-inline\n [bsConfig]="bsDatepickerConfig"\n [datesDisabled]="excludedDatesToDisable"\n bsDatepicker\n [bsValue]="changedValue"\n (bsValueChange)="onDateUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'">\n </bs-datepicker-inline>\n <wm-timepicker\n [value]="changedValue"\n [min]="minTime"\n [max]="maxTime"\n (change)="onTimeUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"></wm-timepicker>\n <span class="text-primary date-picker-value">\n {{getDateLabel()}}\n </span>\n </div>\n <div class="modal-footer">\n <button\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'"\n class="btn btn-secondary today-btn"\n (click)="setToday()">{{appLocale.MESSAGE_DATE_PICKER_TODAY || "Today" }}</button>\n <button\n class="btn btn-primary pull-right ok-btn"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"\n (click)="onOkClick()">{{appLocale.MESSAGE_DATE_PICKER_OK || "Ok" }}</button>\n <button\n class="btn btn-secondary pull-right clear-btn"\n (click)="clear()">{{appLocale.MESSAGE_DATE_PICKER_CLEAR || "Clear" }}</button>\n </div>\n </div>\n </ng-template>\n '
27116
+ template: '\n <ng-template #datetimepickerTemplate>\n <div class="app-datetime-picker">\n <div class="modal-body">\n <div class="mobile-datetime-picker-options">\n\n </div>\n <bs-datepicker-inline\n [bsConfig]="bsDatepickerConfig"\n [datesDisabled]="excludedDatesToDisable"\n bsDatepicker\n [bsValue]="changedValue"\n (bsValueChange)="onDateUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'">\n </bs-datepicker-inline>\n <wm-timepicker\n [value]="changedValue"\n [min]="minTime"\n [max]="maxTime"\n (change)="onTimeUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"></wm-timepicker>\n <span class="text-primary date-picker-value">\n {{getDateLabel()}}\n </span>\n </div>\n <div class="modal-footer">\n <button\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'"\n class="btn btn-secondary today-btn"\n (click)="setToday()">{{appLocale.LABEL_TODAY_DATE || "Today" }}</button>\n <button\n class="btn btn-primary pull-right ok-btn"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"\n (click)="onOkClick()">{{appLocale.LABEL_OK || "Ok" }}</button>\n <button\n class="btn btn-secondary pull-right clear-btn"\n (click)="clear()">{{appLocale.LABEL_CLEAR_DATE || "Clear" }}</button>\n </div>\n </div>\n </ng-template>\n '
27099
27117
  } ]
27100
27118
  } ];
27101
27119
  DateTimePickerComponent.ctorParameters = function() {
@@ -27235,7 +27253,7 @@
27235
27253
  type: core.Component,
27236
27254
  args: [ {
27237
27255
  selector: "wm-timepicker",
27238
- template: ' \n <wm-pickergroup>\n <wm-picker \n [options]="options.hour"\n [selectedValue]="hour"\n (change)="set($event, \'HOUR\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker \n [options]="options.minute"\n [selectedValue]="minute"\n (change)="set($event, \'MINUTE\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker \n [options]="options.minute"\n [selectedValue]="second"\n (change)="set($event, \'SECOND\')"></wm-picker>\n </wm-pickergroup>\n '
27256
+ template: '\n <wm-pickergroup>\n <wm-picker\n [options]="options.hour"\n [selectedValue]="hour"\n (change)="set($event, \'HOUR\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="minute"\n (change)="set($event, \'MINUTE\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="second"\n (change)="set($event, \'SECOND\')"></wm-picker>\n </wm-pickergroup>\n '
27239
27257
  } ]
27240
27258
  } ];
27241
27259
  TimePickerComponent.ctorParameters = function() {
@@ -27290,6 +27308,11 @@
27290
27308
  _this._dateOptions.clearPosition = "right";
27291
27309
  _this.meridians = common.getLocaleDayPeriods(_this.selectedLocale, common.FormStyle.Format, common.TranslationWidth.Abbreviated);
27292
27310
  _this.loadNativeDateInput = core$1.isMobile() && !_this.showcustompicker;
27311
+ _this.cancelLocaleChangeSubscription = _this.getAppInstance().subscribe("locale-changed", (function(locale) {
27312
+ _this.datePipe.datePipe.locale = locale.angular;
27313
+ _this._dateOptions.todayButtonLabel = _this.i18nService.getLocalizedMessage("LABEL_TODAY_DATE");
27314
+ _this._dateOptions.clearButtonLabel = _this.i18nService.getLocalizedMessage("LABEL_CLEAR_DATE");
27315
+ }));
27293
27316
  return _this;
27294
27317
  }
27295
27318
  Object.defineProperty(BaseDateTimeComponent.prototype, "timeZone", {
@@ -27510,6 +27533,8 @@
27510
27533
  if (event.originalEvent) {
27511
27534
  _this.setFocusForDate(-1);
27512
27535
  }
27536
+ var prevMon = _this.getMonth(_this.activeDate, -1);
27537
+ $(".bs-datepicker-head .previous").prepend('<p aria-hidden="false" class="sr-only">Changed to Previous Month, ' + prevMon.fullMonth + " and year " + prevMon.date.getFullYear() + "</p>");
27513
27538
  setTimeout((function() {
27514
27539
  $(".bs-datepicker-head .previous").focus();
27515
27540
  }));
@@ -27521,6 +27546,8 @@
27521
27546
  if (event.originalEvent) {
27522
27547
  _this.setFocusForDate(1);
27523
27548
  }
27549
+ var nextMon = _this.getMonth(_this.activeDate, 1);
27550
+ $(".bs-datepicker-head .next").prepend('<p aria-hidden="false" class="sr-only">Changed to Next Month, ' + nextMon.fullMonth + " and year " + nextMon.date.getFullYear() + "</p>");
27524
27551
  setTimeout((function() {
27525
27552
  $(".bs-datepicker-head .next").focus();
27526
27553
  }));
@@ -27536,21 +27563,10 @@
27536
27563
  _this.setFocusForMonthOrDay();
27537
27564
  }
27538
27565
  }));
27539
- datePickerHead.find(".next").attr("aria-label", "Next Month, " + this.next.fullMonth + " " + this.next.date.getFullYear());
27540
- datePickerHead.find(".previous").attr("aria-label", "Previous Month, " + this.prev.fullMonth + " " + this.prev.date.getFullYear());
27541
- setTimeout((function() {
27542
- var currentNodes = datePickerHead.find(".current span");
27543
- var msg = "Changed to month ";
27544
- datePickerHead.find(".current").attr("aria-live", "assertive").attr("aria-atomic", "false");
27545
- if (_this.clicked) {
27546
- if ($(currentNodes[0]).text()) {
27547
- datePickerHead.find(".ng-star-inserted").prepend('<div class="sr-only">' + msg + "</div>");
27548
- }
27549
- if ($(currentNodes[1]).text()) {
27550
- datePickerHead.find(".current").last().prepend('<div class="sr-only"> and year </div>');
27551
- }
27552
- }
27553
- }));
27566
+ if (!this.clicked) {
27567
+ datePickerHead.find(".next").attr("aria-label", "Next Month, " + this.next.fullMonth + " " + this.next.date.getFullYear());
27568
+ datePickerHead.find(".previous").attr("aria-label", "Previous Month, " + this.prev.fullMonth + " " + this.prev.date.getFullYear());
27569
+ }
27554
27570
  };
27555
27571
  BaseDateTimeComponent.prototype.setFocusForMonthOrDay = function() {
27556
27572
  var activeMonthOrYear = $(".bs-datepicker-head .current").first().text();
@@ -28070,6 +28086,9 @@
28070
28086
  if (this.dateOnShowSubscription) {
28071
28087
  this.dateOnShowSubscription.unsubscribe();
28072
28088
  }
28089
+ if (this.cancelLocaleChangeSubscription) {
28090
+ this.cancelLocaleChangeSubscription();
28091
+ }
28073
28092
  _super.prototype.ngOnDestroy.call(this);
28074
28093
  };
28075
28094
  BaseDateTimeComponent.prototype.ngOnDetach = function() {
@@ -28303,7 +28322,6 @@
28303
28322
  this.invokeEventCallback("click", {
28304
28323
  $event: $event
28305
28324
  });
28306
- this.focusOnInputEl();
28307
28325
  }
28308
28326
  if ($event.target && $($event.target).is("input") && !this.isDropDownDisplayEnabledOnInput(this.showdropdownon)) {
28309
28327
  $event.stopPropagation();
@@ -28690,7 +28708,6 @@
28690
28708
  this.invokeEventCallback("click", {
28691
28709
  $event: $event
28692
28710
  });
28693
- this.focusOnInputEl();
28694
28711
  }
28695
28712
  if ($event.target && $($event.target).is("input") && !this.isDropDownDisplayEnabledOnInput(this.showdropdownon)) {
28696
28713
  $event.stopPropagation();
@@ -29012,7 +29029,6 @@
29012
29029
  this.invokeEventCallback("click", {
29013
29030
  $event: $event
29014
29031
  });
29015
- this.focusOnInputEl();
29016
29032
  }
29017
29033
  if ($event.target && $($event.target).is("input") && !this.isDropDownDisplayEnabledOnInput(this.showdropdownon)) {
29018
29034
  return;
@@ -64635,7 +64651,7 @@
64635
64651
  }
64636
64652
  ImageCacheDirective.prototype.ngDoCheck = function() {
64637
64653
  var _this = this;
64638
- if (this.componentInstance.imgSource && this.componentInstance.imgSource.startsWith("http")) {
64654
+ if (_.isString(this.componentInstance.imgSource) && this.componentInstance.imgSource.startsWith("http")) {
64639
64655
  if (this._lastUrl !== this.componentInstance.imgSource) {
64640
64656
  this._lastUrl = this.componentInstance.imgSource;
64641
64657
  this.componentInstance.imgSource = DEFAULT_IMAGE;
@@ -82913,6 +82929,7 @@
82913
82929
  timezone: "",
82914
82930
  number: ""
82915
82931
  };
82932
+ _this.bundleLoaded = {};
82916
82933
  _this.appLocale = {};
82917
82934
  _this.prefabLocale = new Map;
82918
82935
  return _this;
@@ -82979,6 +82996,8 @@
82979
82996
  _this.extendMessages(bundle.messages);
82980
82997
  _this.extendPrefabMessages(bundle);
82981
82998
  _this.appDefaults.setFormats(bundle.formats);
82999
+ _this.bundleLoaded.app = true;
83000
+ _this.notifyLocaleChanged();
82982
83001
  }));
82983
83002
  };
82984
83003
  I18nServiceImpl.prototype.loadMomentLocaleBundle = function(momentLocale) {
@@ -82995,6 +83014,8 @@
82995
83014
  _config = _config && _config._config;
82996
83015
  chronos.defineLocale(_this.selectedLocale, _config);
82997
83016
  _this.bsLocaleService.use(_this.getSelectedLocale() || _this.defaultSupportedLocale);
83017
+ _this.bundleLoaded.moment = true;
83018
+ _this.notifyLocaleChanged();
82998
83019
  }));
82999
83020
  };
83000
83021
  I18nServiceImpl.prototype.loadAngularLocaleBundle = function(angLocale) {
@@ -83024,6 +83045,7 @@
83024
83045
  return Promise.resolve();
83025
83046
  }
83026
83047
  if (!force && (i2.isMobile() || i2.isMobileApp() || this.selectedLocale === this.defaultSupportedLocale)) {
83048
+ this.bundleLoaded.fullCalendar = true;
83027
83049
  return;
83028
83050
  }
83029
83051
  return i2.loadScripts([ path ], true);
@@ -83053,11 +83075,21 @@
83053
83075
  }));
83054
83076
  };
83055
83077
  I18nServiceImpl.prototype.loadLocaleBundles = function(libLocale) {
83078
+ var _this = this;
83079
+ var _a;
83056
83080
  if (libLocale.moment) {
83057
83081
  this.loadMomentLocaleBundle(libLocale.moment);
83082
+ } else if (this.selectedLocale === this.defaultSupportedLocale) {
83083
+ this.bsLocaleService.use(this.getSelectedLocale() || this.defaultSupportedLocale);
83084
+ this.bundleLoaded.moment = true;
83058
83085
  }
83059
83086
  if (libLocale.fullCalendar && window["FullCalendar"]) {
83060
- this.loadCalendarLocaleBundle(libLocale.fullCalendar);
83087
+ (_a = this.loadCalendarLocaleBundle(libLocale.fullCalendar)) === null || _a === void 0 ? void 0 : _a.then((function() {
83088
+ _this.bundleLoaded.fullCalendar = true;
83089
+ _this.notifyLocaleChanged();
83090
+ }));
83091
+ } else {
83092
+ this.bundleLoaded.fullCalendar = true;
83061
83093
  }
83062
83094
  if (libLocale.angular) {
83063
83095
  this.loadAppLocaleBundle();
@@ -83097,8 +83129,15 @@
83097
83129
  i2.setSessionStorageItem("selectedLocale", locale);
83098
83130
  this.selectedLocale = locale;
83099
83131
  this.init();
83132
+ this.bundleLoaded.moment = false;
83133
+ this.bundleLoaded.fullCalendar = false;
83134
+ this.bundleLoaded.app = false;
83135
+ this.bundleLoaded.angular = false;
83136
+ this.bundleLoaded.libLocale = libLocale;
83100
83137
  return this.loadLocaleBundles(libLocale).then((function() {
83101
- return _this.updateLocaleDirection();
83138
+ _this.updateLocaleDirection();
83139
+ _this.bundleLoaded.angular = true;
83140
+ _this.notifyLocaleChanged();
83102
83141
  }));
83103
83142
  };
83104
83143
  I18nServiceImpl.prototype.deduceAppLocale = function() {
@@ -83134,6 +83173,7 @@
83134
83173
  return defaultLanguage;
83135
83174
  };
83136
83175
  I18nServiceImpl.prototype.loadDefaultLocale = function() {
83176
+ Date.prototype["month"] = Date.prototype.getMonth;
83137
83177
  var locale = this.deduceAppLocale();
83138
83178
  return this.setSelectedLocale(locale);
83139
83179
  };
@@ -83171,6 +83211,11 @@
83171
83211
  I18nServiceImpl.prototype.getwidgetLocale = function() {
83172
83212
  return this.formatsByLocale;
83173
83213
  };
83214
+ I18nServiceImpl.prototype.notifyLocaleChanged = function() {
83215
+ if (this.bundleLoaded.moment && this.bundleLoaded.fullCalendar && this.bundleLoaded.angular && this.bundleLoaded.app) {
83216
+ this.app.notify("locale-changed", this.bundleLoaded.libLocale);
83217
+ }
83218
+ };
83174
83219
  return I18nServiceImpl;
83175
83220
  }(i2.AbstractI18nService);
83176
83221
  I18nServiceImpl.decorators = [ {