@trudb/tru-common-lib 0.2.133 → 0.2.138

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.
@@ -5902,6 +5902,58 @@ class ColumnHeaderButton {
5902
5902
  }
5903
5903
  }
5904
5904
 
5905
+ // @Directive declaration styled same as matMenuTriggerFor
5906
+ // with different selector and exportAs.
5907
+ class TruContextMenuTrigger extends MatMenuTrigger {
5908
+ lastMouseEvent = null;
5909
+ // Duplicate the code for the matMenuTriggerFor binding
5910
+ // using a new property and the public menu accessors.
5911
+ get menu_again() {
5912
+ return this.menu;
5913
+ }
5914
+ set menu_again(menu) {
5915
+ this.menu = menu;
5916
+ }
5917
+ // Override _handleMousedown, and call super._handleMousedown
5918
+ _handleMousedown(event) {
5919
+ this.lastMouseEvent = event;
5920
+ super._handleMousedown(new MouseEvent(event.type));
5921
+ }
5922
+ ngAfterContentInit() {
5923
+ // Can't just override a private method due to how the lib is compiled
5924
+ this['_setPosition'] = (menu, positionStrategy) => {
5925
+ let positions = [];
5926
+ super['_setPosition'](menu, {
5927
+ withPositions: (p) => {
5928
+ positions = p;
5929
+ },
5930
+ });
5931
+ positionStrategy.withPositions(positions);
5932
+ if (this.lastMouseEvent) {
5933
+ positionStrategy.setOrigin({ x: this.lastMouseEvent.clientX, y: this.lastMouseEvent.clientY });
5934
+ }
5935
+ positionStrategy.withViewportMargin(10);
5936
+ };
5937
+ }
5938
+ ngOnDestroy() {
5939
+ super.ngOnDestroy();
5940
+ }
5941
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruContextMenuTrigger, deps: null, target: i0.ɵɵFactoryTarget.Directive });
5942
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.3", type: TruContextMenuTrigger, isStandalone: true, selector: "[truContextMenuTriggerFor]", inputs: { menu_again: ["truContextMenuTriggerFor", "menu_again"] }, host: { classAttribute: "mat-menu-trigger" }, usesInheritance: true, ngImport: i0 });
5943
+ }
5944
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruContextMenuTrigger, decorators: [{
5945
+ type: Directive,
5946
+ args: [{
5947
+ selector: `[truContextMenuTriggerFor]`,
5948
+ host: {
5949
+ class: 'mat-menu-trigger',
5950
+ }
5951
+ }]
5952
+ }], propDecorators: { menu_again: [{
5953
+ type: Input,
5954
+ args: ['truContextMenuTriggerFor']
5955
+ }] } });
5956
+
5905
5957
  class TruDataGridClipboard {
5906
5958
  util;
5907
5959
  uiNotification;
@@ -6067,10 +6119,11 @@ class TruDataGridCellRenderer {
6067
6119
  document.removeEventListener('mouseover', this.onMouseOver);
6068
6120
  }
6069
6121
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridCellRenderer, deps: [{ token: TruDataContext }, { token: TruDataGridClipboard }], target: i0.ɵɵFactoryTarget.Component });
6070
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: TruDataGridCellRenderer, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "contextMenu", first: true, predicate: MatMenuTrigger, descendants: true }], ngImport: i0, template: `<div (contextmenu)="onRightClick($event)">{{displayValue}}
6071
- <mat-menu #truDataGridCellContextMenu="matMenu"
6072
- [style.left]="contextMenuPosition.x"
6073
- [style.top]="contextMenuPosition.y">
6122
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: TruDataGridCellRenderer, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "contextMenu", first: true, predicate: TruContextMenuTrigger, descendants: true }], ngImport: i0, template: `<div (contextmenu)="onRightClick($event)">{{displayValue}}
6123
+ <div style="visibility: hidden; position: absolute;"
6124
+ [truContextMenuTriggerFor]="truDataGridCellContextMenu">
6125
+ </div>
6126
+ <mat-menu #truDataGridCellContextMenu="matMenu">
6074
6127
  <button mat-menu-item (click)="onCopy($event)">
6075
6128
  <mat-icon [svgIcon]="'copy-icon'"></mat-icon>
6076
6129
  <span>Copy</span>
@@ -6080,7 +6133,7 @@ class TruDataGridCellRenderer {
6080
6133
  <span>Paste</span>
6081
6134
  </button>
6082
6135
  </mat-menu>
6083
- </div>`, isInline: true, styles: ["::ng-deep .mat-mdc-menu-item{height:25px!important;min-height:25px!important}::ng-deep .mat-mdc-menu-content mat-icon svg{fill:#949494}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i4$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i4$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6136
+ </div>`, isInline: true, styles: ["::ng-deep .mat-mdc-menu-item{height:25px!important;min-height:25px!important}::ng-deep .mat-mdc-menu-content mat-icon svg{fill:#949494}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i4$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i4$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: TruContextMenuTrigger, selector: "[truContextMenuTriggerFor]", inputs: ["truContextMenuTriggerFor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6084
6137
  }
6085
6138
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridCellRenderer, decorators: [{
6086
6139
  type: Component,
@@ -6090,11 +6143,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
6090
6143
  CommonModule,
6091
6144
  MatIconModule,
6092
6145
  MatButtonModule,
6093
- MatMenuModule
6146
+ MatMenuModule,
6147
+ TruContextMenuTrigger
6094
6148
  ], changeDetection: ChangeDetectionStrategy.OnPush, template: `<div (contextmenu)="onRightClick($event)">{{displayValue}}
6095
- <mat-menu #truDataGridCellContextMenu="matMenu"
6096
- [style.left]="contextMenuPosition.x"
6097
- [style.top]="contextMenuPosition.y">
6149
+ <div style="visibility: hidden; position: absolute;"
6150
+ [truContextMenuTriggerFor]="truDataGridCellContextMenu">
6151
+ </div>
6152
+ <mat-menu #truDataGridCellContextMenu="matMenu">
6098
6153
  <button mat-menu-item (click)="onCopy($event)">
6099
6154
  <mat-icon [svgIcon]="'copy-icon'"></mat-icon>
6100
6155
  <span>Copy</span>
@@ -6107,7 +6162,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
6107
6162
  </div>`, styles: ["::ng-deep .mat-mdc-menu-item{height:25px!important;min-height:25px!important}::ng-deep .mat-mdc-menu-content mat-icon svg{fill:#949494}\n"] }]
6108
6163
  }], ctorParameters: () => [{ type: TruDataContext }, { type: TruDataGridClipboard }], propDecorators: { contextMenu: [{
6109
6164
  type: ViewChild,
6110
- args: [MatMenuTrigger]
6165
+ args: [TruContextMenuTrigger]
6111
6166
  }] } });
6112
6167
 
6113
6168
  class TruDataGridPkeyCellRenderer {