@nova-ui/bits 12.0.6 → 12.0.7-3547

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.
@@ -21389,12 +21389,12 @@
21389
21389
  endDatetimePattern: {},
21390
21390
  },
21391
21391
  "last7Days": {
21392
- name: $localize(templateObject_5 || (templateObject_5 = __makeTemplateObject(["Last 7 days"], ["Last 7 days"]))),
21392
+ name: $localize(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["Last 7 days"], ["Last 7 days"]))),
21393
21393
  startDatetimePattern: { days: -7 },
21394
21394
  endDatetimePattern: {},
21395
21395
  },
21396
21396
  "last30Days": {
21397
- name: $localize(templateObject_6 || (templateObject_6 = __makeTemplateObject(["Last 30 days"], ["Last 30 days"]))),
21397
+ name: $localize(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["Last 30 days"], ["Last 30 days"]))),
21398
21398
  startDatetimePattern: { days: -30 },
21399
21399
  endDatetimePattern: {},
21400
21400
  },
@@ -21542,7 +21542,7 @@
21542
21542
  { type: i0.Injectable }
21543
21543
  ];
21544
21544
  TimeframeService.ctorParameters = function () { return []; };
21545
- var templateObject_1$4, templateObject_2$2, templateObject_3$1, templateObject_4$1, templateObject_5, templateObject_6;
21545
+ var templateObject_1$4, templateObject_2$2, templateObject_3$1, templateObject_4$1, templateObject_5$1, templateObject_6$1;
21546
21546
 
21547
21547
  /**
21548
21548
  * Pipe used for formatting ITimeframe values
@@ -22689,6 +22689,21 @@
22689
22689
  items: [{ type: i0.ContentChildren, args: [ToolbarItemComponent,] }]
22690
22690
  };
22691
22691
 
22692
+ /**
22693
+ * @ignore
22694
+ */
22695
+ var ToolbarMessageComponent = /** @class */ (function () {
22696
+ function ToolbarMessageComponent() {
22697
+ }
22698
+ return ToolbarMessageComponent;
22699
+ }());
22700
+ ToolbarMessageComponent.decorators = [
22701
+ { type: i0.Component, args: [{
22702
+ selector: "nui-toolbar-message",
22703
+ template: "<ng-content></ng-content>"
22704
+ },] }
22705
+ ];
22706
+
22692
22707
  /**
22693
22708
  * @ignore
22694
22709
  */
@@ -22793,13 +22808,17 @@
22793
22808
  ToolbarComponent.prototype.ngAfterViewInit = function () {
22794
22809
  var _this = this;
22795
22810
  this.splitToolbarItems();
22796
- this.childrenSubscription = rxjs.merge(this.groups.changes, this.items.changes).pipe(operators.debounceTime(20)).subscribe(function () {
22811
+ this.childrenSubscription = rxjs.merge(this.groups.changes, this.items.changes)
22812
+ .pipe(operators.debounceTime(20))
22813
+ .subscribe(function () {
22797
22814
  // timeout is needed for updating actual querylist. without it splitToolbarItems won't get new element in groups' arrays
22798
22815
  setTimeout(function () {
22799
22816
  _this.splitToolbarItems();
22800
22817
  }, 0);
22801
22818
  });
22802
- this.ngZone.onStable.asObservable().pipe(operators.take(1))
22819
+ this.ngZone.onStable
22820
+ .asObservable()
22821
+ .pipe(operators.take(1))
22803
22822
  .subscribe(function () {
22804
22823
  _this.moveToolbarItems();
22805
22824
  });
@@ -22808,7 +22827,9 @@
22808
22827
  var isDestructiveItem = group.items.filter(function (item) { return item.displayStyle === exports.ToolbarItemDisplayStyle.destructive; });
22809
22828
  if (isDestructiveItem.length) {
22810
22829
  _this.destructiveItems.push(isDestructiveItem);
22811
- if (_this.destructiveItems.length === 1 && _this.destructiveIsLastItem || _this.destructiveItems.length > 1) {
22830
+ if ((_this.destructiveItems.length === 1 &&
22831
+ _this.destructiveIsLastItem) ||
22832
+ _this.destructiveItems.length > 1) {
22812
22833
  _this.logger.error("Only one tool-bar-item with type destructive may be defined, and it must be the last item in last group");
22813
22834
  }
22814
22835
  }
@@ -22828,10 +22849,12 @@
22828
22849
  ToolbarComponent.prototype.moveToolbarItems = function () {
22829
22850
  this.makeAllItemsVisible();
22830
22851
  var containerBorder = Math.floor(this.toolbarContainer.nativeElement.getBoundingClientRect().right);
22831
- this.lastChildBorder = Math.floor(this.toolbarContainer.nativeElement.lastElementChild.getBoundingClientRect().right);
22832
- while (containerBorder < this.lastChildBorder && this.commandGroups.length > 0) {
22833
- this.commandGroups.forEach(function (group, ind, groups) {
22834
- if (ind === groups.length - 1) {
22852
+ this.lastChildBorder = Math.floor(this.toolbarContainer.nativeElement.lastElementChild.getBoundingClientRect()
22853
+ .right);
22854
+ while (containerBorder < this.lastChildBorder &&
22855
+ this.commandGroups.length > 0) {
22856
+ this.commandGroups.forEach(function (group, index, groups) {
22857
+ if (index === groups.length - 1) {
22835
22858
  group.items.forEach(function (item, index, items) {
22836
22859
  if (index === items.length - 1) {
22837
22860
  item.menuHidden = true;
@@ -22840,7 +22863,8 @@
22840
22863
  }
22841
22864
  });
22842
22865
  this.splitToolbarItems();
22843
- this.lastChildBorder = Math.floor(this.toolbarContainer.nativeElement.lastElementChild.getBoundingClientRect().right);
22866
+ this.lastChildBorder = Math.floor(this.toolbarContainer.nativeElement.lastElementChild.getBoundingClientRect()
22867
+ .right);
22844
22868
  }
22845
22869
  };
22846
22870
  ToolbarComponent.prototype.splitToolbarItems = function () {
@@ -22848,13 +22872,16 @@
22848
22872
  this.commandGroups = [];
22849
22873
  this.menuGroups = [];
22850
22874
  this.groups.forEach(function (group) {
22851
- var commandGroupItems = group.items.filter(function (item) { return item.menuHidden === false; });
22852
- var menuGroupItems = group.items.filter(function (item) { return item.menuHidden === true; });
22875
+ var commandGroupItems = group.items.filter(function (item) { return !item.menuHidden; });
22876
+ var menuGroupItems = group.items.filter(function (item) { return !!item.menuHidden; });
22853
22877
  if (commandGroupItems.length) {
22854
22878
  _this.commandGroups.push({ items: commandGroupItems });
22855
22879
  }
22856
22880
  if (menuGroupItems.length) {
22857
- _this.menuGroups.push({ items: menuGroupItems, title: group.title });
22881
+ _this.menuGroups.push({
22882
+ items: menuGroupItems,
22883
+ title: group.title,
22884
+ });
22858
22885
  }
22859
22886
  });
22860
22887
  this.showMenu = this.menuGroups.length > 0;
@@ -22876,9 +22903,16 @@
22876
22903
  if (!_isEmpty__default["default"](this.selectedItems)) {
22877
22904
  var itemSelected = $localize(templateObject_3 || (templateObject_3 = __makeTemplateObject(["", " of ", " selected"], ["", " of ", " selected"])), this.selectedItems.current, this.selectedItems.total);
22878
22905
  var allItemSelected = $localize(templateObject_4 || (templateObject_4 = __makeTemplateObject(["All ", " selected"], ["All ", " selected"])), this.selectedItems.total);
22879
- return this.selectedItems.current === this.selectedItems.total ? allItemSelected : itemSelected;
22906
+ return this.selectedItems.current === this.selectedItems.total
22907
+ ? allItemSelected
22908
+ : itemSelected;
22880
22909
  }
22881
22910
  }
22911
+ if (_isEmpty__default["default"](this.selectedItems)) {
22912
+ return "";
22913
+ }
22914
+ return this.selectedItems.current === this.selectedItems.total
22915
+ ? $localize(templateObject_5 || (templateObject_5 = __makeTemplateObject(["All ", " selected"], ["All ", " selected"])), this.selectedItems.total) : $localize(templateObject_6 || (templateObject_6 = __makeTemplateObject(["", " of ", " selected"], ["", " of ", " selected"])), this.selectedItems.current, this.selectedItems.total);
22882
22916
  };
22883
22917
  Object.defineProperty(ToolbarComponent.prototype, "menuTitle", {
22884
22918
  get: function () {
@@ -22889,7 +22923,8 @@
22889
22923
  });
22890
22924
  Object.defineProperty(ToolbarComponent.prototype, "destructiveIsLastItem", {
22891
22925
  get: function () {
22892
- return this.groups.last.items.last.displayStyle !== exports.ToolbarItemDisplayStyle.destructive;
22926
+ return (this.groups.last.items.last.displayStyle !==
22927
+ exports.ToolbarItemDisplayStyle.destructive);
22893
22928
  },
22894
22929
  enumerable: false,
22895
22930
  configurable: true
@@ -22899,7 +22934,11 @@
22899
22934
  this.toolbarButtons.changes
22900
22935
  .pipe(operators.takeUntil(this.destroy$))
22901
22936
  .subscribe(function (buttons) {
22902
- _this.toolbarItems = buttons.toArray().slice().map(function (b) { return b["el"].nativeElement; });
22937
+ _this.toolbarItems = buttons
22938
+ .toArray()
22939
+ .slice()
22940
+ .map(function (b) { return b["el"].nativeElement; })
22941
+ .filter(function (el) { return !!el; });
22903
22942
  if (_this.menu) {
22904
22943
  // In case all buttons are hidden within the Commands menu we want this menu to receive the focus
22905
22944
  // If at least one button is visible in the toolbar it should receive the focus first upon navigating onto the toolbar
@@ -22915,14 +22954,14 @@
22915
22954
  ToolbarComponent.decorators = [
22916
22955
  { type: i0.Component, args: [{
22917
22956
  selector: "nui-toolbar",
22918
- template: "<div class=\"nui-toolbar-content d-flex flex-row align-items-center justify-content-between\"\n nuiResizeObserver\n (containerResize)=\"moveToolbarItems()\"\n #toolbarContainer>\n <div class=\"nui-toolbar-content__dynamic d-flex flex-row flex-shrink-0\">\n <ng-template ngFor let-i=\"index\" let-commandGroup let-last=\"last\" [ngForOf]=\"commandGroups\">\n <ng-template ngFor let-commandItem let-j=\"index\" [ngForOf]=\"commandGroup.items\">\n <!-- (!i && !j) is used for set focusable state to first element first group -->\n <button nui-button type=\"button\"\n #toolbarButtons\n [tabindex]=\"(!i && !j) ? 0 : -1\"\n (click)=\"onClickToolbarBtn($event, commandItem)\"\n [displayStyle]=\"commandItem.displayStyle === 'main' ? 'primary' : commandItem.displayStyle\"\n [ngClass]=\"{'nui-toolbar-primary-item': commandItem.displayStyle === 'main'}\"\n [icon]=\"commandItem.icon\">\n <span>{{commandItem.title}}</span>\n </button>\n </ng-template>\n <nui-divider *ngIf=\"!last || showMenu\" class=\"flex-shrink-0\" isVertical=\"true\" size=\"extra-small\"></nui-divider>\n </ng-template>\n <nui-menu displayStyle=\"action\"\n #menuComponent\n [title]=\"menuTitle\"\n *ngIf=\"showMenu\">\n <ng-template ngFor let-menuGroup [ngForOf]=\"menuGroups\">\n <nui-menu-group [header]=\"menuGroup.title\">\n <ng-template ngFor let-menuItem [ngForOf]=\"menuGroup.items\">\n <nui-menu-action [type]=\"menuItem.isDestructive ? 'destructive' : 'default'\"\n [icon]=\"menuItem.icon\"\n (click)=\"menuItem.actionDone.emit()\">{{menuItem.title}}\n </nui-menu-action>\n </ng-template>\n </nui-menu-group>\n </ng-template>\n </nui-menu>\n </div>\n <div class=\"nui-toolbar-content__embedded d-flex\">\n <ng-container *ngIf=\"selectionEnabled\">\n <div class=\"nui-toolbar-content__select d-flex align-items-center flex-shrink-0\">{{handleSelectionState()}}</div>\n </ng-container>\n <ng-content></ng-content>\n <ng-content select=\".nui-toolbar-embedded\" ></ng-content>\n </div>\n</div>\n",
22957
+ template: "<div\n class=\"nui-toolbar-content\"\n nuiResizeObserver\n (containerResize)=\"moveToolbarItems()\"\n #toolbarContainer\n>\n <div class=\"nui-toolbar-content__dynamic\">\n <ng-template\n ngFor\n let-i=\"index\"\n let-commandGroup\n let-last=\"last\"\n [ngForOf]=\"commandGroups\"\n >\n <ng-template\n ngFor\n let-commandItem\n let-j=\"index\"\n [ngForOf]=\"commandGroup.items\"\n >\n <!-- (!i && !j) is used for set focusable state to first element first group -->\n <button\n nui-button\n type=\"button\"\n #toolbarButtons\n [tabindex]=\"!i && !j ? 0 : -1\"\n (click)=\"onClickToolbarBtn($event, commandItem)\"\n [displayStyle]=\"\n commandItem.displayStyle === 'main'\n ? 'primary'\n : commandItem.displayStyle\n \"\n [ngClass]=\"{\n 'nui-toolbar-primary-item':\n commandItem.displayStyle === 'main'\n }\"\n [icon]=\"commandItem.icon\"\n >\n <span>{{ commandItem.title }}</span>\n </button>\n </ng-template>\n <nui-divider\n *ngIf=\"!last || showMenu\"\n isVertical=\"true\"\n size=\"extra-small\"\n ></nui-divider>\n </ng-template>\n <nui-menu\n displayStyle=\"action\"\n #menuComponent\n [title]=\"menuTitle\"\n *ngIf=\"showMenu\"\n >\n <ng-template ngFor let-menuGroup [ngForOf]=\"menuGroups\">\n <nui-menu-group [header]=\"menuGroup.title\">\n <ng-template ngFor let-menuItem [ngForOf]=\"menuGroup.items\">\n <nui-menu-action\n [type]=\"\n menuItem.isDestructive\n ? 'destructive'\n : 'default'\n \"\n [icon]=\"menuItem.icon\"\n (click)=\"menuItem.actionDone.emit()\"\n >{{ menuItem.title }}\n </nui-menu-action>\n </ng-template>\n </nui-menu-group>\n </ng-template>\n </nui-menu>\n <ng-container>\n <nui-toolbar-message *ngIf=\"allItemsHidden && !showMenu\">\n <ng-container *ngIf=\"selectionEnabled\" i18n\n >No actions available for this selection</ng-container\n >\n <ng-container *ngIf=\"!selectionEnabled\" i18n\n >No actions available</ng-container\n >\n </nui-toolbar-message>\n <ng-content select=\"nui-toolbar-message\"></ng-content>\n </ng-container>\n </div>\n <div class=\"nui-toolbar-content__embedded\">\n <ng-container *ngIf=\"selectionEnabled\">\n <div class=\"nui-toolbar-content__select\">\n {{ handleSelectionState() }}\n </div>\n </ng-container>\n <ng-content></ng-content>\n <ng-content select=\".nui-toolbar-embedded\"></ng-content>\n </div>\n</div>\n",
22919
22958
  host: {
22920
- "class": "nui-toolbar nui-strip-layout nui-flex-container",
22921
- "role": "toolbar",
22959
+ class: "nui-toolbar nui-strip-layout nui-flex-container",
22960
+ role: "toolbar",
22922
22961
  },
22923
22962
  encapsulation: i0.ViewEncapsulation.None,
22924
22963
  providers: [ToolbarKeyboardService],
22925
- styles: [".nui .nui-toolbar{position:relative;transition:background-color ease .2s;padding:0 15px}.nui .nui-toolbar--shadowed{box-shadow:inset 0 -1px 0 0 var(--nui-color-line-default, #d9d9d9)}.nui .nui-toolbar--active{background-color:var(--nui-color-selected,rgba(0, 196, 210, .1))}.nui .nui-toolbar-content{width:100%;transition:visibility .25s;padding:5px 0}.nui .nui-toolbar-content__embedded>div{white-space:nowrap}.nui .nui-toolbar-content__dynamic .nui-button.btn-destructive{border-color:transparent}.nui .nui-toolbar-content__dynamic .nui-button.btn-destructive:hover,.nui .nui-toolbar-content__dynamic .nui-button.btn-destructive:active,.nui .nui-toolbar-content__dynamic .nui-button.btn-destructive:focus{border-color:transparent;background-color:var(--nui-color-bg-transparent-hover,rgba(17, 17, 17, .05))}.nui .nui-toolbar-content__select{font-size:11px;font-weight:600;padding-left:10px}.nui .nui-toolbar-group-primary{display:flex}.nui .nui-toolbar-primary-item{margin-right:5px}.nui .nui-toolbar-embedded{margin-left:15px;display:flex;flex-wrap:nowrap}.nui .nui-toolbar-divider{display:table-cell;padding:0 5px}.nui .nui-toolbar-divider-line{width:1px;background:var(--nui-color-line-default,#d9d9d9);height:30px}\n"]
22964
+ styles: [".nui .nui-toolbar{position:relative;transition:background-color ease .2s;padding:0 15px}.nui .nui-toolbar--shadowed{box-shadow:inset 0 -1px 0 0 var(--nui-color-line-default, #d9d9d9)}.nui .nui-toolbar--active{background-color:var(--nui-color-selected,rgba(0, 196, 210, .1))}.nui .nui-toolbar-content{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:space-between;transition:visibility .25s;padding:5px 0}.nui .nui-toolbar-content__embedded{display:flex}.nui .nui-toolbar-content__embedded>div{white-space:nowrap}.nui .nui-toolbar-content__dynamic{display:flex;flex-direction:row;flex-shrink:0}.nui .nui-toolbar-content__dynamic .nui-button.btn-destructive{border-color:transparent}.nui .nui-toolbar-content__dynamic .nui-button.btn-destructive:hover,.nui .nui-toolbar-content__dynamic .nui-button.btn-destructive:active,.nui .nui-toolbar-content__dynamic .nui-button.btn-destructive:focus{border-color:transparent;background-color:var(--nui-color-bg-transparent-hover,rgba(17, 17, 17, .05))}.nui .nui-toolbar-content__dynamic nui-divider{flex-shrink:0}.nui .nui-toolbar-content__select{display:flex;align-items:center;flex-shrink:0;font-size:11px;font-weight:600;padding-left:10px}.nui .nui-toolbar-group-primary{display:flex}.nui .nui-toolbar-primary-item{margin-right:5px}.nui .nui-toolbar-embedded{margin-left:15px;display:flex;flex-wrap:nowrap}.nui .nui-toolbar-divider{display:table-cell;padding:0 5px}.nui .nui-toolbar-divider-line{width:1px;background:var(--nui-color-line-default,#d9d9d9);height:30px}.nui .nui-toolbar nui-toolbar-message{padding:5px 10px;margin-bottom:2px}\n"]
22926
22965
  },] }
22927
22966
  ];
22928
22967
  ToolbarComponent.ctorParameters = function () { return [
@@ -22943,7 +22982,7 @@
22943
22982
  toolbarButtons: [{ type: i0.ViewChildren, args: ["toolbarButtons",] }],
22944
22983
  onKeyDown: [{ type: i0.HostListener, args: ["keydown", ["$event"],] }]
22945
22984
  };
22946
- var templateObject_1$2, templateObject_2$1, templateObject_3, templateObject_4;
22985
+ var templateObject_1$2, templateObject_2$1, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
22947
22986
 
22948
22987
  /**
22949
22988
  * @ignore
@@ -22965,12 +23004,14 @@
22965
23004
  declarations: [
22966
23005
  ToolbarComponent,
22967
23006
  ToolbarItemComponent,
23007
+ ToolbarMessageComponent,
22968
23008
  ToolbarSplitterComponent,
22969
23009
  ToolbarGroupComponent,
22970
23010
  ],
22971
23011
  exports: [
22972
23012
  ToolbarComponent,
22973
23013
  ToolbarItemComponent,
23014
+ ToolbarMessageComponent,
22974
23015
  ToolbarSplitterComponent,
22975
23016
  ToolbarGroupComponent,
22976
23017
  ],
@@ -25139,6 +25180,7 @@
25139
25180
  exports.ToolbarComponent = ToolbarComponent;
25140
25181
  exports.ToolbarGroupComponent = ToolbarGroupComponent;
25141
25182
  exports.ToolbarItemComponent = ToolbarItemComponent;
25183
+ exports.ToolbarMessageComponent = ToolbarMessageComponent;
25142
25184
  exports.ToolbarSplitterComponent = ToolbarSplitterComponent;
25143
25185
  exports.TooltipComponent = TooltipComponent;
25144
25186
  exports.TooltipDirective = TooltipDirective;