@trudb/tru-common-lib 0.2.7 → 0.2.10

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.
@@ -3412,7 +3412,16 @@ const COLLAPSE_ICON = `
3412
3412
  <svg height="20px" viewBox="0 -960 960 960" width="24px" fill="#000"><path d="m296-80-56-56 240-240 240 240-56 56-184-184L296-80Zm184-504L240-824l56-56 184 184 184-184 56 56-240 240Z"/></svg>
3413
3413
  `;
3414
3414
  const SEARCH_ICON = `
3415
- <svg height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M765-144 526-383q-30 22-65.79 34.5-35.79 12.5-76.18 12.5Q284-336 214-406t-70-170q0-100 70-170t170-70q100 0 170 70t70 170.03q0 40.39-12.5 76.18Q599-464 577-434l239 239-51 51ZM384-408q70 0 119-49t49-119q0-70-49-119t-119-49q-70 0-119 49t-49 119q0 70 49 119t119 49Z"/></svg>
3415
+ <svg height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M765-144 526-383q-30 22-65.79 34.5-35.79 12.5-76.18 12.5Q284-336 214-406t-70-170q0-100 70-170t170-70q100 0 170 70t70 170.03q0 40.39-12.5 76.18Q599-464 577-434l239 239-51 51ZM384-408q70 0 119-49t49-119q0-70-49-119t-119-49q-70 0-119 49t-49 119q0 70 49 119t119 49Z"/></svg>
3416
+ `;
3417
+ const COPY_ICON = `
3418
+ <svg height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M360-240q-29.7 0-50.85-21.15Q288-282.3 288-312v-480q0-29.7 21.15-50.85Q330.3-864 360-864h384q29.7 0 50.85 21.15Q816-821.7 816-792v480q0 29.7-21.15 50.85Q773.7-240 744-240H360Zm0-72h384v-480H360v480ZM216-96q-29.7 0-50.85-21.15Q144-138.3 144-168v-552h72v552h456v72H216Zm144-216v-480 480Z"/></svg>
3419
+ `;
3420
+ const PASTE_ICON = `
3421
+ <svg height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M216-144q-29.7 0-50.85-21.15Q144-186.3 144-216v-528q0-29.7 21.15-50.85Q186.3-816 216-816h171q8-31 33.5-51.5T480-888q34 0 59.5 20.5T573-816h171q29.7 0 50.85 21.15Q816-773.7 816-744v528q0 29.7-21.15 50.85Q773.7-144 744-144H216Zm0-72h528v-528h-72v120H288v-120h-72v528Zm263.79-528q15.21 0 25.71-10.29t10.5-25.5q0-15.21-10.29-25.71t-25.5-10.5q-15.21 0-25.71 10.29t-10.5 25.5q0 15.21 10.29 25.71t25.5 10.5Z"/></svg>
3422
+ `;
3423
+ const INSERT_ICON = `
3424
+ <svg height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M216-192h528v-228H216v228Zm600 72H144v-672h144V-719.51h-72V-492h528v-228h-72v-72h144v672ZM480-492Zm0 72v-72 72Zm0 0Zm-36-216v-84h-84v-72h84v-84h72v84h84v72h-84v84h-72Z"/></svg>
3416
3425
  `;
3417
3426
  class TruIconModule {
3418
3427
  constructor(sanitizer, iconRegistry) {
@@ -3440,6 +3449,9 @@ class TruIconModule {
3440
3449
  iconRegistry.addSvgIconLiteral("expand-icon", sanitizer.bypassSecurityTrustHtml(EXPAND_ICON));
3441
3450
  iconRegistry.addSvgIconLiteral("collapse-icon", sanitizer.bypassSecurityTrustHtml(COLLAPSE_ICON));
3442
3451
  iconRegistry.addSvgIconLiteral("search-icon", sanitizer.bypassSecurityTrustHtml(SEARCH_ICON));
3452
+ iconRegistry.addSvgIconLiteral("copy-icon", sanitizer.bypassSecurityTrustHtml(COPY_ICON));
3453
+ iconRegistry.addSvgIconLiteral("paste-icon", sanitizer.bypassSecurityTrustHtml(PASTE_ICON));
3454
+ iconRegistry.addSvgIconLiteral("insert-icon", sanitizer.bypassSecurityTrustHtml(INSERT_ICON));
3443
3455
  }
3444
3456
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruIconModule, deps: [{ token: i1$5.DomSanitizer }, { token: i2$1.MatIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
3445
3457
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: TruIconModule, imports: [CommonModule, FormsModule] });
@@ -5892,20 +5904,22 @@ class TruDataGridPkeyCellRenderer {
5892
5904
  contextMenu;
5893
5905
  params;
5894
5906
  contextMenuPosition = { x: '0px', y: '0px' };
5907
+ displayValue = '';
5895
5908
  // private eGui: is an empty element to satisfy the getGui method.
5896
5909
  eGui;
5897
5910
  onRightClick = (event) => {
5898
5911
  event.preventDefault();
5899
- this.contextMenuPosition.x = (event.clientX - 27) + 'px';
5900
- this.contextMenuPosition.y = event.clientY + 'px';
5912
+ this.contextMenuPosition.x = event.clientX + 'px';
5913
+ this.contextMenuPosition.y = (event.clientY - 130) + 'px';
5901
5914
  this.contextMenu.menu?.focusFirstItem('mouse');
5902
5915
  this.contextMenu.openMenu();
5903
5916
  };
5904
5917
  agInit(params) {
5905
5918
  this.params = params;
5906
- let value = params.value;
5907
5919
  if (params.value < 0)
5908
- value = 'NEW';
5920
+ this.displayValue = 'NEW';
5921
+ else
5922
+ this.displayValue = params.value;
5909
5923
  params.eGridCell.addEventListener('contextmenu', this.onRightClick);
5910
5924
  }
5911
5925
  getGui() {
@@ -5916,7 +5930,7 @@ class TruDataGridPkeyCellRenderer {
5916
5930
  }
5917
5931
  destroy() { }
5918
5932
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridPkeyCellRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component });
5919
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: TruDataGridPkeyCellRenderer, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "contextMenu", first: true, predicate: MatMenuTrigger, descendants: true }], ngImport: i0, template: `<div (contextmenu)="onRightClick($event)">{{params.value}}
5933
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: TruDataGridPkeyCellRenderer, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "contextMenu", first: true, predicate: MatMenuTrigger, descendants: true }], ngImport: i0, template: `<div (contextmenu)="onRightClick($event)">{{displayValue}}
5920
5934
  <div style="visibility: hidden; position: fixed"
5921
5935
  [style.left]="contextMenuPosition.x"
5922
5936
  [style.top]="contextMenuPosition.y"
@@ -5924,16 +5938,19 @@ class TruDataGridPkeyCellRenderer {
5924
5938
  </div>
5925
5939
  <mat-menu #truDataGridContextMenu="matMenu">
5926
5940
  <button mat-menu-item>
5941
+ <mat-icon [svgIcon]="'copy-icon'"></mat-icon>
5927
5942
  <span>Copy</span>
5928
5943
  </button>
5929
5944
  <button mat-menu-item disabled>
5945
+ <mat-icon [svgIcon]="'paste-icon'"></mat-icon>
5930
5946
  <span>Paste</span>
5931
5947
  </button>
5932
5948
  <button mat-menu-item>
5949
+ <mat-icon [svgIcon]="'insert-icon'"></mat-icon>
5933
5950
  <span>Insert At Top</span>
5934
5951
  </button>
5935
5952
  </mat-menu>
5936
- </div>`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i5.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: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5953
+ </div>`, isInline: true, styles: [""], 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: i5.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: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5937
5954
  }
5938
5955
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridPkeyCellRenderer, decorators: [{
5939
5956
  type: Component,
@@ -5943,9 +5960,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
5943
5960
  CommonModule,
5944
5961
  MatIconModule,
5945
5962
  MatButtonModule,
5946
- MatMenuModule,
5947
- MatIconModule
5948
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: `<div (contextmenu)="onRightClick($event)">{{params.value}}
5963
+ MatMenuModule
5964
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: `<div (contextmenu)="onRightClick($event)">{{displayValue}}
5949
5965
  <div style="visibility: hidden; position: fixed"
5950
5966
  [style.left]="contextMenuPosition.x"
5951
5967
  [style.top]="contextMenuPosition.y"
@@ -5953,12 +5969,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
5953
5969
  </div>
5954
5970
  <mat-menu #truDataGridContextMenu="matMenu">
5955
5971
  <button mat-menu-item>
5972
+ <mat-icon [svgIcon]="'copy-icon'"></mat-icon>
5956
5973
  <span>Copy</span>
5957
5974
  </button>
5958
5975
  <button mat-menu-item disabled>
5976
+ <mat-icon [svgIcon]="'paste-icon'"></mat-icon>
5959
5977
  <span>Paste</span>
5960
5978
  </button>
5961
5979
  <button mat-menu-item>
5980
+ <mat-icon [svgIcon]="'insert-icon'"></mat-icon>
5962
5981
  <span>Insert At Top</span>
5963
5982
  </button>
5964
5983
  </mat-menu>