@wavemaker/app-runtime-wm-build 11.4.1-rc.123 → 11.4.1-rc.5386

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.1-rc.123",
3
+ "version": "11.4.1-rc.5386",
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")) {
@@ -4387,7 +4387,7 @@
4387
4387
  }();
4388
4388
  var MINIMUM_MOBILE_WIDTH = 480;
4389
4389
  var MINIMUM_TAB_WIDTH = 768;
4390
- var MINIMUM_LARGE_SCREEN_WIDTH = 1280;
4390
+ var MINIMUM_LARGE_SCREEN_WIDTH = 1200;
4391
4391
  var IViewportService = function() {
4392
4392
  function IViewportService() {}
4393
4393
  return IViewportService;
@@ -4472,11 +4472,13 @@
4472
4472
  } else {
4473
4473
  MINIMUM_MOBILE_WIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--screen-xs")) || 480;
4474
4474
  MINIMUM_TAB_WIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--screen-sm")) || 768;
4475
- if (minValue >= MINIMUM_MOBILE_WIDTH && maxValue >= MINIMUM_TAB_WIDTH) {
4475
+ MINIMUM_LARGE_SCREEN_WIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--screen-lg")) || 1200;
4476
+ if (this.screenWidth >= MINIMUM_LARGE_SCREEN_WIDTH) {
4477
+ this.isTabletType = isAndroid() || isIos() || isAndroidTablet();
4478
+ this.isMobileType = false;
4479
+ } else if (this.screenWidth >= MINIMUM_TAB_WIDTH) {
4476
4480
  this.type = 1;
4477
- if (isAndroid() || isIos() || isAndroidTablet()) {
4478
- this.isTabletType = true;
4479
- }
4481
+ this.isTabletType = true;
4480
4482
  } else {
4481
4483
  this.type = 0;
4482
4484
  this.isMobileType = true;
@@ -17279,6 +17281,9 @@
17279
17281
  core$1.$appDigest();
17280
17282
  }), 150);
17281
17283
  _this.handleHeaderClick = core$1.noop;
17284
+ _this.cancelLocaleChangeSubscription = _this.getAppInstance().subscribe("locale-changed", (function() {
17285
+ _this._debouncedInitDatasetItems();
17286
+ }));
17282
17287
  return _this;
17283
17288
  }
17284
17289
  Object.defineProperty(DatasetAwareFormComponent.prototype, "modelByKey", {
@@ -17491,6 +17496,11 @@
17491
17496
  this.toggleAllHeaders = base.toggleAllHeaders.bind(undefined, this);
17492
17497
  }
17493
17498
  };
17499
+ DatasetAwareFormComponent.prototype.ngOnDestroy = function() {
17500
+ if (this.cancelLocaleChangeSubscription) {
17501
+ this.cancelLocaleChangeSubscription();
17502
+ }
17503
+ };
17494
17504
  return DatasetAwareFormComponent;
17495
17505
  }(BaseFormCustomComponent);
17496
17506
  DatasetAwareFormComponent.decorators = [ {
@@ -22301,17 +22311,11 @@
22301
22311
  });
22302
22312
  };
22303
22313
  SearchComponent.prototype.onFocusOut = function() {
22304
- var _this = this;
22305
22314
  this._unsubscribeDv = false;
22306
22315
  this._loadingItems = false;
22307
22316
  this.page = 1;
22308
22317
  if (!this._domUpdated && this._isOpen) {
22309
22318
  this.listenQuery = false;
22310
- setTimeout((function() {
22311
- if (_this.typeahead._typeahead.isShown) {
22312
- _this.typeahead.hide();
22313
- }
22314
- }), 200);
22315
22319
  }
22316
22320
  this._isOpen = false;
22317
22321
  if (this._domUpdated && this.typeahead && this.typeahead._container) {
@@ -24050,6 +24054,11 @@
24050
24054
  i18nService.initCalendarLocale();
24051
24055
  FullCalendar.__wm_locale_initialized = true;
24052
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
+ }));
24053
24062
  return _this;
24054
24063
  }
24055
24064
  CalendarComponent.prototype.selectDate = function() {
@@ -24512,6 +24521,11 @@
24512
24521
  }));
24513
24522
  }));
24514
24523
  };
24524
+ CalendarComponent.prototype.ngOnDestroy = function() {
24525
+ if (this.cancelLocaleChangeSubscription) {
24526
+ this.cancelLocaleChangeSubscription();
24527
+ }
24528
+ };
24515
24529
  return CalendarComponent;
24516
24530
  }(base.StylableComponent);
24517
24531
  CalendarComponent.initializeProps = registerProps();
@@ -27099,7 +27113,7 @@
27099
27113
  type: core.Component,
27100
27114
  args: [ {
27101
27115
  selector: "wm-datetimepicker",
27102
- 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 '
27103
27117
  } ]
27104
27118
  } ];
27105
27119
  DateTimePickerComponent.ctorParameters = function() {
@@ -27239,7 +27253,7 @@
27239
27253
  type: core.Component,
27240
27254
  args: [ {
27241
27255
  selector: "wm-timepicker",
27242
- 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 '
27243
27257
  } ]
27244
27258
  } ];
27245
27259
  TimePickerComponent.ctorParameters = function() {
@@ -27294,6 +27308,11 @@
27294
27308
  _this._dateOptions.clearPosition = "right";
27295
27309
  _this.meridians = common.getLocaleDayPeriods(_this.selectedLocale, common.FormStyle.Format, common.TranslationWidth.Abbreviated);
27296
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
+ }));
27297
27316
  return _this;
27298
27317
  }
27299
27318
  Object.defineProperty(BaseDateTimeComponent.prototype, "timeZone", {
@@ -27514,6 +27533,8 @@
27514
27533
  if (event.originalEvent) {
27515
27534
  _this.setFocusForDate(-1);
27516
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>");
27517
27538
  setTimeout((function() {
27518
27539
  $(".bs-datepicker-head .previous").focus();
27519
27540
  }));
@@ -27525,6 +27546,8 @@
27525
27546
  if (event.originalEvent) {
27526
27547
  _this.setFocusForDate(1);
27527
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>");
27528
27551
  setTimeout((function() {
27529
27552
  $(".bs-datepicker-head .next").focus();
27530
27553
  }));
@@ -27540,21 +27563,10 @@
27540
27563
  _this.setFocusForMonthOrDay();
27541
27564
  }
27542
27565
  }));
27543
- datePickerHead.find(".next").attr("aria-label", "Next Month, " + this.next.fullMonth + " " + this.next.date.getFullYear());
27544
- datePickerHead.find(".previous").attr("aria-label", "Previous Month, " + this.prev.fullMonth + " " + this.prev.date.getFullYear());
27545
- setTimeout((function() {
27546
- var currentNodes = datePickerHead.find(".current span");
27547
- var msg = "Changed to month ";
27548
- datePickerHead.find(".current").attr("aria-live", "assertive").attr("aria-atomic", "false");
27549
- if (_this.clicked) {
27550
- if ($(currentNodes[0]).text()) {
27551
- datePickerHead.find(".ng-star-inserted").prepend('<div class="sr-only">' + msg + "</div>");
27552
- }
27553
- if ($(currentNodes[1]).text()) {
27554
- datePickerHead.find(".current").last().prepend('<div class="sr-only"> and year </div>');
27555
- }
27556
- }
27557
- }));
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
+ }
27558
27570
  };
27559
27571
  BaseDateTimeComponent.prototype.setFocusForMonthOrDay = function() {
27560
27572
  var activeMonthOrYear = $(".bs-datepicker-head .current").first().text();
@@ -28074,6 +28086,9 @@
28074
28086
  if (this.dateOnShowSubscription) {
28075
28087
  this.dateOnShowSubscription.unsubscribe();
28076
28088
  }
28089
+ if (this.cancelLocaleChangeSubscription) {
28090
+ this.cancelLocaleChangeSubscription();
28091
+ }
28077
28092
  _super.prototype.ngOnDestroy.call(this);
28078
28093
  };
28079
28094
  BaseDateTimeComponent.prototype.ngOnDetach = function() {
@@ -28202,8 +28217,11 @@
28202
28217
  return core$1.getFormattedDate(this.datePipe, this.bsDataValue, this.outputformat, this.timeZone, null, this.isCurrentDate, this) || "";
28203
28218
  },
28204
28219
  set: function(newVal) {
28220
+ var _this = this;
28205
28221
  if (newVal === CURRENT_DATE$1) {
28206
- this.bsDataValue = this.timeZone ? core$1.getMomentLocaleObject(this.timeZone) : new Date;
28222
+ setTimeout((function() {
28223
+ _this.bsDataValue = _this.timeZone ? core$1.getMomentLocaleObject(_this.timeZone) : new Date;
28224
+ }), 50);
28207
28225
  this.isCurrentDate = true;
28208
28226
  } else {
28209
28227
  this.bsDataValue = newVal ? core$1.getDateObj(newVal, {
@@ -28304,7 +28322,6 @@
28304
28322
  this.invokeEventCallback("click", {
28305
28323
  $event: $event
28306
28324
  });
28307
- this.focusOnInputEl();
28308
28325
  }
28309
28326
  if ($event.target && $($event.target).is("input") && !this.isDropDownDisplayEnabledOnInput(this.showdropdownon)) {
28310
28327
  $event.stopPropagation();
@@ -28691,7 +28708,6 @@
28691
28708
  this.invokeEventCallback("click", {
28692
28709
  $event: $event
28693
28710
  });
28694
- this.focusOnInputEl();
28695
28711
  }
28696
28712
  if ($event.target && $($event.target).is("input") && !this.isDropDownDisplayEnabledOnInput(this.showdropdownon)) {
28697
28713
  $event.stopPropagation();
@@ -29013,7 +29029,6 @@
29013
29029
  this.invokeEventCallback("click", {
29014
29030
  $event: $event
29015
29031
  });
29016
- this.focusOnInputEl();
29017
29032
  }
29018
29033
  if ($event.target && $($event.target).is("input") && !this.isDropDownDisplayEnabledOnInput(this.showdropdownon)) {
29019
29034
  return;
@@ -58646,6 +58661,7 @@
58646
58661
  _this.heading = heading;
58647
58662
  _this.title = title;
58648
58663
  _this._isFirstLoad = true;
58664
+ _this._isOnLoadTriggered = false;
58649
58665
  _this.$lazyLoad = core.noop;
58650
58666
  _this.isActive = false;
58651
58667
  _this.disabled = false;
@@ -58696,6 +58712,10 @@
58696
58712
  return c.redraw();
58697
58713
  }));
58698
58714
  }
58715
+ if (!_this._isOnLoadTriggered && !_this.content) {
58716
+ _this.invokeEventCallback("load");
58717
+ _this._isOnLoadTriggered = true;
58718
+ }
58699
58719
  }), 100);
58700
58720
  };
58701
58721
  TabPaneComponent.prototype.notifyParent = function(evt) {
@@ -68305,6 +68325,7 @@
68305
68325
  timezone: "",
68306
68326
  number: ""
68307
68327
  };
68328
+ _this.bundleLoaded = {};
68308
68329
  _this.appLocale = {};
68309
68330
  _this.prefabLocale = new Map;
68310
68331
  return _this;
@@ -68371,6 +68392,8 @@
68371
68392
  _this.extendMessages(bundle.messages);
68372
68393
  _this.extendPrefabMessages(bundle);
68373
68394
  _this.appDefaults.setFormats(bundle.formats);
68395
+ _this.bundleLoaded.app = true;
68396
+ _this.notifyLocaleChanged();
68374
68397
  }));
68375
68398
  };
68376
68399
  I18nServiceImpl.prototype.loadMomentLocaleBundle = function(momentLocale) {
@@ -68387,6 +68410,8 @@
68387
68410
  _config = _config && _config._config;
68388
68411
  chronos.defineLocale(_this.selectedLocale, _config);
68389
68412
  _this.bsLocaleService.use(_this.getSelectedLocale() || _this.defaultSupportedLocale);
68413
+ _this.bundleLoaded.moment = true;
68414
+ _this.notifyLocaleChanged();
68390
68415
  }));
68391
68416
  };
68392
68417
  I18nServiceImpl.prototype.loadAngularLocaleBundle = function(angLocale) {
@@ -68416,6 +68441,7 @@
68416
68441
  return Promise.resolve();
68417
68442
  }
68418
68443
  if (!force && (i2.isMobile() || i2.isMobileApp() || this.selectedLocale === this.defaultSupportedLocale)) {
68444
+ this.bundleLoaded.fullCalendar = true;
68419
68445
  return;
68420
68446
  }
68421
68447
  return i2.loadScripts([ path ], true);
@@ -68445,11 +68471,21 @@
68445
68471
  }));
68446
68472
  };
68447
68473
  I18nServiceImpl.prototype.loadLocaleBundles = function(libLocale) {
68474
+ var _this = this;
68475
+ var _a;
68448
68476
  if (libLocale.moment) {
68449
68477
  this.loadMomentLocaleBundle(libLocale.moment);
68478
+ } else if (this.selectedLocale === this.defaultSupportedLocale) {
68479
+ this.bsLocaleService.use(this.getSelectedLocale() || this.defaultSupportedLocale);
68480
+ this.bundleLoaded.moment = true;
68450
68481
  }
68451
68482
  if (libLocale.fullCalendar && window["FullCalendar"]) {
68452
- this.loadCalendarLocaleBundle(libLocale.fullCalendar);
68483
+ (_a = this.loadCalendarLocaleBundle(libLocale.fullCalendar)) === null || _a === void 0 ? void 0 : _a.then((function() {
68484
+ _this.bundleLoaded.fullCalendar = true;
68485
+ _this.notifyLocaleChanged();
68486
+ }));
68487
+ } else {
68488
+ this.bundleLoaded.fullCalendar = true;
68453
68489
  }
68454
68490
  if (libLocale.angular) {
68455
68491
  this.loadAppLocaleBundle();
@@ -68489,8 +68525,15 @@
68489
68525
  i2.setSessionStorageItem("selectedLocale", locale);
68490
68526
  this.selectedLocale = locale;
68491
68527
  this.init();
68528
+ this.bundleLoaded.moment = false;
68529
+ this.bundleLoaded.fullCalendar = false;
68530
+ this.bundleLoaded.app = false;
68531
+ this.bundleLoaded.angular = false;
68532
+ this.bundleLoaded.libLocale = libLocale;
68492
68533
  return this.loadLocaleBundles(libLocale).then((function() {
68493
- return _this.updateLocaleDirection();
68534
+ _this.updateLocaleDirection();
68535
+ _this.bundleLoaded.angular = true;
68536
+ _this.notifyLocaleChanged();
68494
68537
  }));
68495
68538
  };
68496
68539
  I18nServiceImpl.prototype.deduceAppLocale = function() {
@@ -68526,6 +68569,7 @@
68526
68569
  return defaultLanguage;
68527
68570
  };
68528
68571
  I18nServiceImpl.prototype.loadDefaultLocale = function() {
68572
+ Date.prototype["month"] = Date.prototype.getMonth;
68529
68573
  var locale = this.deduceAppLocale();
68530
68574
  return this.setSelectedLocale(locale);
68531
68575
  };
@@ -68563,6 +68607,11 @@
68563
68607
  I18nServiceImpl.prototype.getwidgetLocale = function() {
68564
68608
  return this.formatsByLocale;
68565
68609
  };
68610
+ I18nServiceImpl.prototype.notifyLocaleChanged = function() {
68611
+ if (this.bundleLoaded.moment && this.bundleLoaded.fullCalendar && this.bundleLoaded.angular && this.bundleLoaded.app) {
68612
+ this.app.notify("locale-changed", this.bundleLoaded.libLocale);
68613
+ }
68614
+ };
68566
68615
  return I18nServiceImpl;
68567
68616
  }(i2.AbstractI18nService);
68568
68617
  I18nServiceImpl.decorators = [ {