@wavemaker/app-runtime-wm-build 11.4.3-next.25756 → 11.4.3-next.30202

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/app-runtime-wm-build",
3
- "version": "11.4.3-next.25756",
3
+ "version": "11.4.3-next.30202",
4
4
  "description": "All modules required for a wavemaker application.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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")) {
@@ -17071,9 +17071,7 @@
17071
17071
  };
17072
17072
  BaseFormCustomComponent.prototype.invokeOnChange = function(value, $event, valid) {
17073
17073
  this._onChange(value);
17074
- if (valid) {
17075
- _super.prototype.invokeOnChange.call(this, value, $event);
17076
- }
17074
+ _super.prototype.invokeOnChange.call(this, value, $event);
17077
17075
  };
17078
17076
  BaseFormCustomComponent.prototype.invokeOnTouched = function($event) {
17079
17077
  this._onTouched();
@@ -17281,6 +17279,9 @@
17281
17279
  core$1.$appDigest();
17282
17280
  }), 150);
17283
17281
  _this.handleHeaderClick = core$1.noop;
17282
+ _this.cancelLocaleChangeSubscription = _this.getAppInstance().subscribe("locale-changed", (function() {
17283
+ _this._debouncedInitDatasetItems();
17284
+ }));
17284
17285
  return _this;
17285
17286
  }
17286
17287
  Object.defineProperty(DatasetAwareFormComponent.prototype, "modelByKey", {
@@ -17493,6 +17494,11 @@
17493
17494
  this.toggleAllHeaders = base.toggleAllHeaders.bind(undefined, this);
17494
17495
  }
17495
17496
  };
17497
+ DatasetAwareFormComponent.prototype.ngOnDestroy = function() {
17498
+ if (this.cancelLocaleChangeSubscription) {
17499
+ this.cancelLocaleChangeSubscription();
17500
+ }
17501
+ };
17496
17502
  return DatasetAwareFormComponent;
17497
17503
  }(BaseFormCustomComponent);
17498
17504
  DatasetAwareFormComponent.decorators = [ {
@@ -24046,6 +24052,11 @@
24046
24052
  i18nService.initCalendarLocale();
24047
24053
  FullCalendar.__wm_locale_initialized = true;
24048
24054
  }
24055
+ _this.cancelLocaleChangeSubscription = _this.getAppInstance().subscribe("locale-changed", (function(libLocale) {
24056
+ _this.setLocale();
24057
+ _this.applyCalendarOptions("option", "locale", libLocale.fullCalendar || "en");
24058
+ _this.redraw();
24059
+ }));
24049
24060
  return _this;
24050
24061
  }
24051
24062
  CalendarComponent.prototype.selectDate = function() {
@@ -24508,6 +24519,11 @@
24508
24519
  }));
24509
24520
  }));
24510
24521
  };
24522
+ CalendarComponent.prototype.ngOnDestroy = function() {
24523
+ if (this.cancelLocaleChangeSubscription) {
24524
+ this.cancelLocaleChangeSubscription();
24525
+ }
24526
+ };
24511
24527
  return CalendarComponent;
24512
24528
  }(base.StylableComponent);
24513
24529
  CalendarComponent.initializeProps = registerProps();
@@ -27095,7 +27111,7 @@
27095
27111
  type: core.Component,
27096
27112
  args: [ {
27097
27113
  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 '
27114
+ 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
27115
  } ]
27100
27116
  } ];
27101
27117
  DateTimePickerComponent.ctorParameters = function() {
@@ -27235,7 +27251,7 @@
27235
27251
  type: core.Component,
27236
27252
  args: [ {
27237
27253
  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 '
27254
+ 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
27255
  } ]
27240
27256
  } ];
27241
27257
  TimePickerComponent.ctorParameters = function() {
@@ -27290,6 +27306,11 @@
27290
27306
  _this._dateOptions.clearPosition = "right";
27291
27307
  _this.meridians = common.getLocaleDayPeriods(_this.selectedLocale, common.FormStyle.Format, common.TranslationWidth.Abbreviated);
27292
27308
  _this.loadNativeDateInput = core$1.isMobile() && !_this.showcustompicker;
27309
+ _this.cancelLocaleChangeSubscription = _this.getAppInstance().subscribe("locale-changed", (function(locale) {
27310
+ _this.datePipe.datePipe.locale = locale.angular;
27311
+ _this._dateOptions.todayButtonLabel = _this.i18nService.getLocalizedMessage("LABEL_TODAY_DATE");
27312
+ _this._dateOptions.clearButtonLabel = _this.i18nService.getLocalizedMessage("LABEL_CLEAR_DATE");
27313
+ }));
27293
27314
  return _this;
27294
27315
  }
27295
27316
  Object.defineProperty(BaseDateTimeComponent.prototype, "timeZone", {
@@ -27510,6 +27531,8 @@
27510
27531
  if (event.originalEvent) {
27511
27532
  _this.setFocusForDate(-1);
27512
27533
  }
27534
+ var prevMon = _this.getMonth(_this.activeDate, -1);
27535
+ $(".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
27536
  setTimeout((function() {
27514
27537
  $(".bs-datepicker-head .previous").focus();
27515
27538
  }));
@@ -27521,6 +27544,8 @@
27521
27544
  if (event.originalEvent) {
27522
27545
  _this.setFocusForDate(1);
27523
27546
  }
27547
+ var nextMon = _this.getMonth(_this.activeDate, 1);
27548
+ $(".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
27549
  setTimeout((function() {
27525
27550
  $(".bs-datepicker-head .next").focus();
27526
27551
  }));
@@ -27536,21 +27561,10 @@
27536
27561
  _this.setFocusForMonthOrDay();
27537
27562
  }
27538
27563
  }));
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
- }));
27564
+ if (!this.clicked) {
27565
+ datePickerHead.find(".next").attr("aria-label", "Next Month, " + this.next.fullMonth + " " + this.next.date.getFullYear());
27566
+ datePickerHead.find(".previous").attr("aria-label", "Previous Month, " + this.prev.fullMonth + " " + this.prev.date.getFullYear());
27567
+ }
27554
27568
  };
27555
27569
  BaseDateTimeComponent.prototype.setFocusForMonthOrDay = function() {
27556
27570
  var activeMonthOrYear = $(".bs-datepicker-head .current").first().text();
@@ -28070,6 +28084,9 @@
28070
28084
  if (this.dateOnShowSubscription) {
28071
28085
  this.dateOnShowSubscription.unsubscribe();
28072
28086
  }
28087
+ if (this.cancelLocaleChangeSubscription) {
28088
+ this.cancelLocaleChangeSubscription();
28089
+ }
28073
28090
  _super.prototype.ngOnDestroy.call(this);
28074
28091
  };
28075
28092
  BaseDateTimeComponent.prototype.ngOnDetach = function() {
@@ -28303,7 +28320,6 @@
28303
28320
  this.invokeEventCallback("click", {
28304
28321
  $event: $event
28305
28322
  });
28306
- this.focusOnInputEl();
28307
28323
  }
28308
28324
  if ($event.target && $($event.target).is("input") && !this.isDropDownDisplayEnabledOnInput(this.showdropdownon)) {
28309
28325
  $event.stopPropagation();
@@ -28690,7 +28706,6 @@
28690
28706
  this.invokeEventCallback("click", {
28691
28707
  $event: $event
28692
28708
  });
28693
- this.focusOnInputEl();
28694
28709
  }
28695
28710
  if ($event.target && $($event.target).is("input") && !this.isDropDownDisplayEnabledOnInput(this.showdropdownon)) {
28696
28711
  $event.stopPropagation();
@@ -29012,7 +29027,6 @@
29012
29027
  this.invokeEventCallback("click", {
29013
29028
  $event: $event
29014
29029
  });
29015
- this.focusOnInputEl();
29016
29030
  }
29017
29031
  if ($event.target && $($event.target).is("input") && !this.isDropDownDisplayEnabledOnInput(this.showdropdownon)) {
29018
29032
  return;
@@ -68309,6 +68323,7 @@
68309
68323
  timezone: "",
68310
68324
  number: ""
68311
68325
  };
68326
+ _this.bundleLoaded = {};
68312
68327
  _this.appLocale = {};
68313
68328
  _this.prefabLocale = new Map;
68314
68329
  return _this;
@@ -68375,6 +68390,8 @@
68375
68390
  _this.extendMessages(bundle.messages);
68376
68391
  _this.extendPrefabMessages(bundle);
68377
68392
  _this.appDefaults.setFormats(bundle.formats);
68393
+ _this.bundleLoaded.app = true;
68394
+ _this.notifyLocaleChanged();
68378
68395
  }));
68379
68396
  };
68380
68397
  I18nServiceImpl.prototype.loadMomentLocaleBundle = function(momentLocale) {
@@ -68391,6 +68408,8 @@
68391
68408
  _config = _config && _config._config;
68392
68409
  chronos.defineLocale(_this.selectedLocale, _config);
68393
68410
  _this.bsLocaleService.use(_this.getSelectedLocale() || _this.defaultSupportedLocale);
68411
+ _this.bundleLoaded.moment = true;
68412
+ _this.notifyLocaleChanged();
68394
68413
  }));
68395
68414
  };
68396
68415
  I18nServiceImpl.prototype.loadAngularLocaleBundle = function(angLocale) {
@@ -68420,6 +68439,7 @@
68420
68439
  return Promise.resolve();
68421
68440
  }
68422
68441
  if (!force && (i2.isMobile() || i2.isMobileApp() || this.selectedLocale === this.defaultSupportedLocale)) {
68442
+ this.bundleLoaded.fullCalendar = true;
68423
68443
  return;
68424
68444
  }
68425
68445
  return i2.loadScripts([ path ], true);
@@ -68449,11 +68469,21 @@
68449
68469
  }));
68450
68470
  };
68451
68471
  I18nServiceImpl.prototype.loadLocaleBundles = function(libLocale) {
68472
+ var _this = this;
68473
+ var _a;
68452
68474
  if (libLocale.moment) {
68453
68475
  this.loadMomentLocaleBundle(libLocale.moment);
68476
+ } else if (this.selectedLocale === this.defaultSupportedLocale) {
68477
+ this.bsLocaleService.use(this.getSelectedLocale() || this.defaultSupportedLocale);
68478
+ this.bundleLoaded.moment = true;
68454
68479
  }
68455
68480
  if (libLocale.fullCalendar && window["FullCalendar"]) {
68456
- this.loadCalendarLocaleBundle(libLocale.fullCalendar);
68481
+ (_a = this.loadCalendarLocaleBundle(libLocale.fullCalendar)) === null || _a === void 0 ? void 0 : _a.then((function() {
68482
+ _this.bundleLoaded.fullCalendar = true;
68483
+ _this.notifyLocaleChanged();
68484
+ }));
68485
+ } else {
68486
+ this.bundleLoaded.fullCalendar = true;
68457
68487
  }
68458
68488
  if (libLocale.angular) {
68459
68489
  this.loadAppLocaleBundle();
@@ -68493,8 +68523,15 @@
68493
68523
  i2.setSessionStorageItem("selectedLocale", locale);
68494
68524
  this.selectedLocale = locale;
68495
68525
  this.init();
68526
+ this.bundleLoaded.moment = false;
68527
+ this.bundleLoaded.fullCalendar = false;
68528
+ this.bundleLoaded.app = false;
68529
+ this.bundleLoaded.angular = false;
68530
+ this.bundleLoaded.libLocale = libLocale;
68496
68531
  return this.loadLocaleBundles(libLocale).then((function() {
68497
- return _this.updateLocaleDirection();
68532
+ _this.updateLocaleDirection();
68533
+ _this.bundleLoaded.angular = true;
68534
+ _this.notifyLocaleChanged();
68498
68535
  }));
68499
68536
  };
68500
68537
  I18nServiceImpl.prototype.deduceAppLocale = function() {
@@ -68530,6 +68567,7 @@
68530
68567
  return defaultLanguage;
68531
68568
  };
68532
68569
  I18nServiceImpl.prototype.loadDefaultLocale = function() {
68570
+ Date.prototype["month"] = Date.prototype.getMonth;
68533
68571
  var locale = this.deduceAppLocale();
68534
68572
  return this.setSelectedLocale(locale);
68535
68573
  };
@@ -68567,6 +68605,11 @@
68567
68605
  I18nServiceImpl.prototype.getwidgetLocale = function() {
68568
68606
  return this.formatsByLocale;
68569
68607
  };
68608
+ I18nServiceImpl.prototype.notifyLocaleChanged = function() {
68609
+ if (this.bundleLoaded.moment && this.bundleLoaded.fullCalendar && this.bundleLoaded.angular && this.bundleLoaded.app) {
68610
+ this.app.notify("locale-changed", this.bundleLoaded.libLocale);
68611
+ }
68612
+ };
68570
68613
  return I18nServiceImpl;
68571
68614
  }(i2.AbstractI18nService);
68572
68615
  I18nServiceImpl.decorators = [ {