@trudb/tru-common-lib 0.2.132 → 0.2.137
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;
|
|
@@ -6069,13 +6121,9 @@ class TruDataGridCellRenderer {
|
|
|
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
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: MatMenuTrigger, descendants: true }], ngImport: i0, template: `<div (contextmenu)="onRightClick($event)">{{displayValue}}
|
|
6071
6123
|
<div style="visibility: hidden; position: absolute;"
|
|
6072
|
-
[
|
|
6073
|
-
[style.top]="0"
|
|
6074
|
-
[matMenuTriggerFor]="truDataGridCellContextMenu">
|
|
6124
|
+
[truContextMenuTriggerFor]="truDataGridCellContextMenu">
|
|
6075
6125
|
</div>
|
|
6076
|
-
<mat-menu #truDataGridCellContextMenu="matMenu"
|
|
6077
|
-
[style.left]="contextMenuPosition.x"
|
|
6078
|
-
[style.top]="contextMenuPosition.y">
|
|
6126
|
+
<mat-menu #truDataGridCellContextMenu="matMenu">
|
|
6079
6127
|
<button mat-menu-item (click)="onCopy($event)">
|
|
6080
6128
|
<mat-icon [svgIcon]="'copy-icon'"></mat-icon>
|
|
6081
6129
|
<span>Copy</span>
|
|
@@ -6085,7 +6133,7 @@ class TruDataGridCellRenderer {
|
|
|
6085
6133
|
<span>Paste</span>
|
|
6086
6134
|
</button>
|
|
6087
6135
|
</mat-menu>
|
|
6088
|
-
</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:
|
|
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 });
|
|
6089
6137
|
}
|
|
6090
6138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridCellRenderer, decorators: [{
|
|
6091
6139
|
type: Component,
|
|
@@ -6095,16 +6143,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
6095
6143
|
CommonModule,
|
|
6096
6144
|
MatIconModule,
|
|
6097
6145
|
MatButtonModule,
|
|
6098
|
-
MatMenuModule
|
|
6146
|
+
MatMenuModule,
|
|
6147
|
+
TruContextMenuTrigger
|
|
6099
6148
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: `<div (contextmenu)="onRightClick($event)">{{displayValue}}
|
|
6100
6149
|
<div style="visibility: hidden; position: absolute;"
|
|
6101
|
-
[
|
|
6102
|
-
[style.top]="0"
|
|
6103
|
-
[matMenuTriggerFor]="truDataGridCellContextMenu">
|
|
6150
|
+
[truContextMenuTriggerFor]="truDataGridCellContextMenu">
|
|
6104
6151
|
</div>
|
|
6105
|
-
<mat-menu #truDataGridCellContextMenu="matMenu"
|
|
6106
|
-
[style.left]="contextMenuPosition.x"
|
|
6107
|
-
[style.top]="contextMenuPosition.y">
|
|
6152
|
+
<mat-menu #truDataGridCellContextMenu="matMenu">
|
|
6108
6153
|
<button mat-menu-item (click)="onCopy($event)">
|
|
6109
6154
|
<mat-icon [svgIcon]="'copy-icon'"></mat-icon>
|
|
6110
6155
|
<span>Copy</span>
|