@wavemaker/app-runtime-wm-build 11.4.0-next.24560 → 11.4.0-next.24562

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.
@@ -5052,7 +5052,7 @@
5052
5052
  fieldDefs = [];
5053
5053
  parent.gridOptions.setCurrentPage(1);
5054
5054
  }
5055
- var currentPage = parent.currentPage;
5055
+ var currentPage = parent.gridOptions.showviewlessbutton && parent.gridOptions.mode === "viewless" ? parent.gridOptions.getCurrentPage() : parent.currentPage;
5056
5056
  var dataNavigator = parent.dataNavigator;
5057
5057
  var pagesize = parent.pagesize;
5058
5058
  if (!isDefined(fieldDefs) || dataNavigator.isFirstPage()) {
@@ -8652,6 +8652,16 @@
8652
8652
  var routeRegex = new RegExp("^(#/|#)" + routeName + "$");
8653
8653
  return routeRegex.test(link);
8654
8654
  };
8655
+ var hasLinkToCurrentPage = function(nodes, routeUrl) {
8656
+ return nodes.some((function(node) {
8657
+ if (isActiveNavItem(node.link, routeUrl)) {
8658
+ return true;
8659
+ }
8660
+ if (node.children) {
8661
+ return hasLinkToCurrentPage(node.children, routeUrl);
8662
+ }
8663
+ }));
8664
+ };
8655
8665
  var getOrderByExpr = function(pageableObj) {
8656
8666
  pageableObj = pageableObj || [];
8657
8667
  var expressions = [], KEY_VAL_SEPARATOR = " ", FIELD_SEPARATOR = ",";
@@ -13022,6 +13032,7 @@
13022
13032
  exports.getWidgetPropsByType = getWidgetPropsByType;
13023
13033
  exports.groupData = groupData;
13024
13034
  exports.handleHeaderClick = handleHeaderClick;
13035
+ exports.hasLinkToCurrentPage = hasLinkToCurrentPage;
13025
13036
  exports.interpolateBindExpressions = interpolateBindExpressions;
13026
13037
  exports.isActiveNavItem = isActiveNavItem;
13027
13038
  exports.isBooleanAttr = isBooleanAttr;
@@ -27371,6 +27382,7 @@
27371
27382
  };
27372
27383
  BaseDateTimeComponent.prototype.setActiveDateFocus = function(newDate, isMouseEvent) {
27373
27384
  var _this = this;
27385
+ this.setNextData(newDate);
27374
27386
  var activeMonth = this.activeDate.getMonth();
27375
27387
  if (!isMouseEvent) {
27376
27388
  if (newDate.getMonth() < activeMonth) {
@@ -27452,8 +27464,8 @@
27452
27464
  _this.setFocusForMonthOrDay();
27453
27465
  }
27454
27466
  }));
27455
- datePickerHead.find(".next").attr("aria-label", "Next Month " + this.next.fullMonth + " " + this.next.date.getFullYear());
27456
- datePickerHead.find(".previous").attr("aria-label", "Previous Month " + this.prev.fullMonth + " " + this.prev.date.getFullYear());
27467
+ datePickerHead.find(".next").attr("aria-label", "Next Month, " + this.next.fullMonth + " " + this.next.date.getFullYear());
27468
+ datePickerHead.find(".previous").attr("aria-label", "Previous Month, " + this.prev.fullMonth + " " + this.prev.date.getFullYear());
27457
27469
  };
27458
27470
  BaseDateTimeComponent.prototype.setFocusForMonthOrDay = function() {
27459
27471
  var activeMonthOrYear = $(".bs-datepicker-head .current").first().text();
@@ -27519,14 +27531,14 @@
27519
27531
  this.loadDays();
27520
27532
  this.setActiveDateFocus(this.activeDate);
27521
27533
  };
27534
+ BaseDateTimeComponent.prototype.setNextData = function(nextDate) {
27535
+ this.next = this.getMonth(nextDate, 1);
27536
+ this.prev = this.getMonth(nextDate, -1);
27537
+ };
27522
27538
  BaseDateTimeComponent.prototype.loadDays = function() {
27523
27539
  var _this = this;
27524
27540
  setTimeout((function() {
27525
27541
  $("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex", "0");
27526
- if (_this.clicked === false) {
27527
- _this.next = _this.getMonth(_this.activeDate, 1);
27528
- _this.prev = _this.getMonth(_this.activeDate, -1);
27529
- }
27530
27542
  _this.addKeyBoardEventsForDays();
27531
27543
  _this.addDatepickerMouseEvents();
27532
27544
  }));
@@ -27641,6 +27653,7 @@
27641
27653
  };
27642
27654
  BaseDateTimeComponent.prototype.setActiveMonthFocus = function(newDate, isMoouseEvent) {
27643
27655
  var _this = this;
27656
+ this.setNextData(newDate);
27644
27657
  var newMonth = months[newDate.getMonth()];
27645
27658
  if (!isMoouseEvent) {
27646
27659
  if (newDate.getFullYear() < this.activeDate.getFullYear()) {
@@ -33596,9 +33609,10 @@
33596
33609
  };
33597
33610
  var MenuComponent = function(_super) {
33598
33611
  __extends(MenuComponent, _super);
33599
- function MenuComponent(inj, route, userDefinedExecutionContext, bsDropdown, parentNav, selectEventCB) {
33612
+ function MenuComponent(inj, route, app, userDefinedExecutionContext, bsDropdown, parentNav, selectEventCB) {
33600
33613
  var _this = _super.call(this, inj, WIDGET_CONFIG$1) || this;
33601
33614
  _this.route = route;
33615
+ _this.app = app;
33602
33616
  _this.userDefinedExecutionContext = userDefinedExecutionContext;
33603
33617
  _this.bsDropdown = bsDropdown;
33604
33618
  _this.parentNav = parentNav;
@@ -33612,6 +33626,9 @@
33612
33626
  }
33613
33627
  var datasetSubscription = _this.nodes$.subscribe((function() {
33614
33628
  if (!_.isEmpty(_this.nodes)) {
33629
+ if (base.hasLinkToCurrentPage(_this.nodes, _this.route.url)) {
33630
+ core.addClass(_this.nativeElement.querySelector(".dropdown-toggle"), "active");
33631
+ }
33615
33632
  if (_this.parentNav) {
33616
33633
  return;
33617
33634
  }
@@ -33686,26 +33703,22 @@
33686
33703
  }
33687
33704
  $event.preventDefault();
33688
33705
  };
33689
- MenuComponent.prototype.hasLinkToCurrentPage = function(nodes) {
33690
- var _this = this;
33691
- return nodes.some((function(node) {
33692
- if (base.isActiveNavItem(node.link, _this.route.url)) {
33693
- return true;
33694
- }
33695
- if (node.children) {
33696
- return _this.hasLinkToCurrentPage(node.children);
33697
- }
33698
- }));
33699
- };
33700
33706
  MenuComponent.prototype.resetNodes = function() {
33701
33707
  _super.prototype.resetNodes.call(this);
33702
- if (this.autoopen === AUTO_OPEN.ACTIVE_PAGE && this.hasLinkToCurrentPage(this.nodes) || this.autoopen === AUTO_OPEN.ALWAYS) {
33708
+ if (this.autoopen === AUTO_OPEN.ACTIVE_PAGE && base.hasLinkToCurrentPage(this.nodes, this.route.url) || this.autoopen === AUTO_OPEN.ALWAYS) {
33703
33709
  this.bsDropdown.show();
33704
33710
  }
33705
33711
  };
33706
33712
  MenuComponent.prototype.ngOnInit = function() {
33713
+ var _this = this;
33707
33714
  _super.prototype.ngOnInit.call(this);
33708
33715
  this.setMenuPosition();
33716
+ var cancelSubscription = this.app.subscribe("highlightActiveLink", (function(data) {
33717
+ core.toggleClass(_this.nativeElement.querySelector(".dropdown-toggle"), "active", base.hasLinkToCurrentPage(_this.nodes, _this.route.url));
33718
+ }));
33719
+ this.registerDestroyListener((function() {
33720
+ return cancelSubscription();
33721
+ }));
33709
33722
  };
33710
33723
  MenuComponent.prototype.onPropertyChange = function(key, nv, ov) {
33711
33724
  if (key === "tabindex") {
@@ -33776,6 +33789,8 @@
33776
33789
  type: core$1.Injector
33777
33790
  }, {
33778
33791
  type: router.Router
33792
+ }, {
33793
+ type: core.App
33779
33794
  }, {
33780
33795
  type: core.UserDefinedExecutionContext
33781
33796
  }, {
@@ -33893,8 +33908,9 @@
33893
33908
  VERTICAL: "vertical"
33894
33909
  };
33895
33910
  var MenuDropdownItemComponent = function() {
33896
- function MenuDropdownItemComponent(menuRef, userDefinedExecutionContext, parentNav, elRef) {
33911
+ function MenuDropdownItemComponent(app, menuRef, userDefinedExecutionContext, parentNav, elRef) {
33897
33912
  var _this = this;
33913
+ this.app = app;
33898
33914
  this.menuRef = menuRef;
33899
33915
  this.userDefinedExecutionContext = userDefinedExecutionContext;
33900
33916
  this.parentNav = parentNav;
@@ -33920,10 +33936,14 @@
33920
33936
  this.menualign = menuAlignClass[this.menuRef.menualign] || menuAlignClass["pull-left"];
33921
33937
  }
33922
33938
  MenuDropdownItemComponent.prototype.ngOnInit = function() {
33939
+ var _this = this;
33923
33940
  if (this.parentNav) {
33924
- if (base.isActiveNavItem(this.item.link, this.menuRef.route.url)) {
33941
+ if (base.hasLinkToCurrentPage([ this.item ], this.menuRef.route.url)) {
33925
33942
  core.addClass(this.nativeElement, "active");
33926
33943
  }
33944
+ this.highlightActiveLinkSubscription = this.app.subscribe("highlightActiveLink", (function(data) {
33945
+ core.toggleClass(_this.nativeElement, "active", base.hasLinkToCurrentPage([ _this.item ], _this.menuRef.route.url));
33946
+ }));
33927
33947
  }
33928
33948
  };
33929
33949
  MenuDropdownItemComponent.prototype.getInitialKeyMovements = function() {
@@ -33992,6 +34012,11 @@
33992
34012
  $event.stopPropagation();
33993
34013
  }
33994
34014
  };
34015
+ MenuDropdownItemComponent.prototype.ngOnDestroy = function() {
34016
+ if (this.highlightActiveLinkSubscription) {
34017
+ this.highlightActiveLinkSubscription();
34018
+ }
34019
+ };
33995
34020
  return MenuDropdownItemComponent;
33996
34021
  }();
33997
34022
  MenuDropdownItemComponent.decorators = [ {
@@ -34003,6 +34028,8 @@
34003
34028
  } ];
34004
34029
  MenuDropdownItemComponent.ctorParameters = function() {
34005
34030
  return [ {
34031
+ type: core.App
34032
+ }, {
34006
34033
  type: MenuComponent
34007
34034
  }, {
34008
34035
  type: core.UserDefinedExecutionContext
@@ -42338,7 +42365,7 @@
42338
42365
  }
42339
42366
  this.isDisableCurrent = isCurrentPageFirst && isCurrentPageLast;
42340
42367
  if (this.dataset && this.dataset.length && this.isDisableNext && this.parent.onDemandLoad && this.parent.widgetType === "wm-table") {
42341
- this.parent.callDataGridMethod("hideLoadingIndicator", this.isDisableNext, false);
42368
+ this.parent.callDataGridMethod("hideLoadingIndicator", this.isDisableNext, this.parent.infScroll);
42342
42369
  }
42343
42370
  };
42344
42371
  PaginationComponent.prototype.isDataSourceHasPaging = function() {
@@ -44707,7 +44734,7 @@
44707
44734
  ListComponent.prototype.handleKeyDown = function($event, action) {
44708
44735
  var _this = this;
44709
44736
  $event.stopPropagation();
44710
- if ($event.keyCode !== 13 && $event.keyCode !== 9 && !($event.target.classList.contains("form-control") && $event.keyCode === 32)) {
44737
+ if ($event.keyCode !== 13 && $event.keyCode !== 9 && !(($event.target.classList.contains("form-control") || $event.target.classList.contains("note-editable")) && $event.keyCode === 32)) {
44711
44738
  $event.preventDefault();
44712
44739
  }
44713
44740
  var listItems = this.listItems;
@@ -45576,6 +45603,10 @@
45576
45603
  value: "No data found."
45577
45604
  }, base.PROP_STRING) ], [ "ondemandmessage", Object.assign({
45578
45605
  value: "Load More"
45606
+ }, base.PROP_STRING) ], [ "showviewlessbutton", Object.assign({
45607
+ value: false
45608
+ }, base.PROP_BOOLEAN) ], [ "viewlessmessage", Object.assign({
45609
+ value: "View Less"
45579
45610
  }, base.PROP_STRING) ], [ "pagesize", base.PROP_NUMBER ], [ "radioselect", base.PROP_BOOLEAN ], [ "rowclass", base.PROP_STRING ], [ "rowngclass", base.PROP_STRING ], [ "searchlabel", Object.assign({
45580
45611
  value: "Search"
45581
45612
  }, base.PROP_STRING) ], [ "show", Object.assign({
@@ -45656,6 +45687,7 @@
45656
45687
  _this.columns = {};
45657
45688
  _this.formfields = {};
45658
45689
  _this.enablesort = true;
45690
+ _this.showviewlessbutton = false;
45659
45691
  _this.primaryKey = [];
45660
45692
  _this.selectedItems = [];
45661
45693
  _this.selectedItemChange = new rxjs.Subject;
@@ -45698,6 +45730,7 @@
45698
45730
  data: [],
45699
45731
  colDefs: [],
45700
45732
  startRowIndex: 1,
45733
+ mode: "",
45701
45734
  sortInfo: {
45702
45735
  field: "",
45703
45736
  direction: ""
@@ -45728,6 +45761,10 @@
45728
45761
  isSearchTrigerred: false,
45729
45762
  isDatasetUpdated: false,
45730
45763
  isDataUpdatedByUser: false,
45764
+ showviewlessbutton: false,
45765
+ ondemandmessage: "",
45766
+ viewlessmessage: "",
45767
+ loadingdatamsg: "",
45731
45768
  isNextPageData: undefined,
45732
45769
  ACTIONS: {
45733
45770
  DELETE: "delete",
@@ -45752,6 +45789,14 @@
45752
45789
  getPageSize: function() {
45753
45790
  return _this.pagesize;
45754
45791
  },
45792
+ getPageCount: function() {
45793
+ return _this.dataNavigator.pageCount;
45794
+ },
45795
+ enableNavigation: function() {
45796
+ _this.dataNavigator.widget.isDisableNext = false;
45797
+ _this.dataNavigator.widget.isDisableLast = false;
45798
+ _this.gridOptions.mode = "viewless";
45799
+ },
45755
45800
  setDeletedRowIndex: function(id) {
45756
45801
  _this.setDataGridOption("deletedRowIndex", id);
45757
45802
  },
@@ -45786,7 +45831,9 @@
45786
45831
  }
45787
45832
  _this.callDataGridMethod("selectRows", _this.items);
45788
45833
  _this.selectedItems = _this.callDataGridMethod("getSelectedRows");
45789
- _this.selectedItemChange.next(_this.selectedItems);
45834
+ if (_this.selectedItems.length) {
45835
+ _this.selectedItemChange.next(_this.selectedItems);
45836
+ }
45790
45837
  if (_this._isPageSearch && _this.filterInfo) {
45791
45838
  _this.searchSortHandler(_this.filterInfo, undefined, "search");
45792
45839
  }
@@ -45795,9 +45842,11 @@
45795
45842
  onRowSelect: function(row, e) {
45796
45843
  _this.ngZone.run((function() {
45797
45844
  _this.selectedItems = _this.callDataGridMethod("getSelectedRows");
45798
- _this.selectedItemChange.next(_this.selectedItems);
45845
+ if (_this.selectedItems.length) {
45846
+ _this.selectedItemChange.next(_this.selectedItems);
45847
+ }
45799
45848
  var rowData = _this.addRowIndex(row);
45800
- if (rowData.$index && _this.getConfiguredState() !== "none" && _this.dataNavigator && base.unsupportedStatePersistenceTypes.indexOf(_this.navigation) < 0) {
45849
+ if (_this.selectedItems.length && rowData.$index && _this.getConfiguredState() !== "none" && _this.dataNavigator && base.unsupportedStatePersistenceTypes.indexOf(_this.navigation) < 0) {
45801
45850
  var obj = {
45802
45851
  page: _this.dataNavigator.dn.currentPage,
45803
45852
  index: rowData.$index - 1
@@ -46237,9 +46286,14 @@
46237
46286
  _this.callDataGridMethod("addLoadMoreBtn", _this.ondemandmessage, _this.loadingdatamsg, (function($event) {
46238
46287
  _this.gridOptions.setIsNextPageData(true);
46239
46288
  _this.gridOptions.setIsDataUpdatedByUser(false);
46240
- _this.dataNavigator.navigatePage("next", $event);
46241
- _this.isDataLoading = true;
46242
- }));
46289
+ if (_this.gridOptions.mode === "viewless") {
46290
+ _this.dataNavigator.navigatePage("first", $event, true);
46291
+ _this.gridOptions.mode = "";
46292
+ } else {
46293
+ _this.dataNavigator.navigatePage("next", $event);
46294
+ _this.isDataLoading = true;
46295
+ }
46296
+ }), _this.infScroll);
46243
46297
  },
46244
46298
  bindScrollEvt: function() {
46245
46299
  if (_this._gridData && _this._gridData.length && _this.infScroll) {
@@ -46517,6 +46571,10 @@
46517
46571
  this.gridOptions.securityUtils.pipeTransform = this.trustAsPipe;
46518
46572
  this.gridOptions.navigation = this.navigation;
46519
46573
  this.gridOptions.isdynamictable = this.isdynamictable;
46574
+ this.gridOptions.showviewlessbutton = this.showviewlessbutton;
46575
+ this.gridOptions.ondemandmessage = this.ondemandmessage;
46576
+ this.gridOptions.viewlessmessage = this.viewlessmessage;
46577
+ this.gridOptions.loadingdatamsg = this.loadingdatamsg;
46520
46578
  if (!_.isEmpty(this.gridData)) {
46521
46579
  this.gridOptions.data = core.getClonedObject(this.gridData);
46522
46580
  }
@@ -47254,6 +47312,11 @@
47254
47312
  if (nv) {
47255
47313
  this.$element.find(".on-demand-datagrid > a").text(nv);
47256
47314
  }
47315
+ this.gridOptions.ondemandmessage = nv;
47316
+ break;
47317
+
47318
+ case "viewlessmessage":
47319
+ this.gridOptions.viewlessmessage = nv;
47257
47320
  break;
47258
47321
 
47259
47322
  case "show":