@trudb/tru-common-lib 0.0.955 → 0.0.956

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Input, Injectable, Component, Inject, HostListener, InjectionToken, NgModule, EventEmitter, ViewEncapsulation, Output, APP_INITIALIZER, ViewChildren, ViewChild } from '@angular/core';
2
+ import { Directive, Input, Injectable, Component, Inject, HostListener, InjectionToken, NgModule, EventEmitter, ViewEncapsulation, Output, createComponent, APP_INITIALIZER, ViewChildren, ViewChild } from '@angular/core';
3
3
  import { EntityAspect, MetadataStore, DataService, EntityManager, EntityQuery, Predicate, FetchStrategy, EntityState, breeze, BinaryPredicate, AndOrPredicate } from 'breeze-client';
4
4
  import { BehaviorSubject, from, defer, of, Subject, Observable, skip, forkJoin, finalize, throwError } from 'rxjs';
5
5
  import * as _ from 'underscore';
@@ -2778,6 +2778,203 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
2778
2778
  }]
2779
2779
  }] });
2780
2780
 
2781
+ class TruGridValidationDialogConfig {
2782
+ _entity;
2783
+ _propertyName;
2784
+ _errorMsg;
2785
+ _mergeData;
2786
+ get entity() {
2787
+ return this._entity;
2788
+ }
2789
+ get propertyName() {
2790
+ return this._propertyName;
2791
+ }
2792
+ get errorMsg() {
2793
+ return this._errorMsg;
2794
+ }
2795
+ get mergeData() {
2796
+ return this._mergeData;
2797
+ }
2798
+ constructor(entity, propertyName, errorMsg, mergeData = null) {
2799
+ this._entity = entity;
2800
+ this._propertyName = propertyName;
2801
+ this._errorMsg = errorMsg;
2802
+ this._mergeData = mergeData;
2803
+ }
2804
+ }
2805
+
2806
+ class TruUtil {
2807
+ constructor() { }
2808
+ tryParseInt = (str, defaultValue) => {
2809
+ var retValue = defaultValue;
2810
+ if (str !== null) {
2811
+ if (str.length > 0) {
2812
+ if (!isNaN(str)) {
2813
+ retValue = parseInt(str);
2814
+ }
2815
+ }
2816
+ }
2817
+ return retValue;
2818
+ };
2819
+ tryParseBool(value, defaultValue) {
2820
+ return (value == 'true' || value == 'false' || value === true || value === false) && JSON.parse(value) || defaultValue;
2821
+ }
2822
+ findClosestAncestorByClass = (element, cssSelector) => {
2823
+ let firstChar = cssSelector.charAt(0);
2824
+ for (; element; element = element.parentNode) {
2825
+ if (firstChar === '.') {
2826
+ if (element.classList && element.classList.contains(cssSelector.substr(1))) {
2827
+ return element;
2828
+ }
2829
+ }
2830
+ }
2831
+ return null;
2832
+ };
2833
+ isNumeric = (n) => {
2834
+ return !isNaN(parseFloat(n)) && isFinite(n);
2835
+ };
2836
+ removeNonNumericCharactersFromStr = (value) => {
2837
+ return value.replace(/[^0-9]/g, '');
2838
+ };
2839
+ isDate = (date) => {
2840
+ if (Object.prototype.toString.call(date) === '[object Date]') {
2841
+ if (isNaN(date.getTime())) {
2842
+ return false;
2843
+ }
2844
+ else {
2845
+ return true;
2846
+ }
2847
+ }
2848
+ else {
2849
+ return false;
2850
+ }
2851
+ };
2852
+ isValidDate = (value) => {
2853
+ return !isNaN(Date.parse(value));
2854
+ };
2855
+ rulesEval = (styles) => {
2856
+ let defaultStyles = {
2857
+ 'backgroundColor': '#ffffff',
2858
+ 'color': '#000000',
2859
+ 'font-style': 'normal',
2860
+ 'text-decoration': 'unset'
2861
+ };
2862
+ if (styles === null)
2863
+ return defaultStyles;
2864
+ if (Object.entries(styles).length !== 0) {
2865
+ Object.assign(defaultStyles, styles);
2866
+ return defaultStyles;
2867
+ }
2868
+ return defaultStyles;
2869
+ };
2870
+ /**
2871
+ * Serializes an object as URL parameters. The object should be a base type or have
2872
+ * properties that are each base types. Does not support a property with structure.
2873
+ * @param {Object} data
2874
+ * @returns {String}
2875
+ */
2876
+ formatAsUrlParameters = (data) => {
2877
+ if (typeof data !== 'object' || data === null)
2878
+ return (data == null ? '' : data.toString());
2879
+ var buffer = [];
2880
+ for (var name in data) {
2881
+ if (!data.hasOwnProperty(name)) {
2882
+ continue;
2883
+ }
2884
+ var value = data[name];
2885
+ buffer.push(encodeURIComponent(name) +
2886
+ '=' + encodeURIComponent(value == null ? '' : value));
2887
+ }
2888
+ var source = buffer.join('&')
2889
+ .replace(/%20/g, '+');
2890
+ return (source);
2891
+ };
2892
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruUtil, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2893
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruUtil, providedIn: 'root' });
2894
+ }
2895
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruUtil, decorators: [{
2896
+ type: Injectable,
2897
+ args: [{
2898
+ providedIn: 'root',
2899
+ }]
2900
+ }], ctorParameters: () => [] });
2901
+
2902
+ class TruGridValidationDialog {
2903
+ renderer;
2904
+ elementRef;
2905
+ util;
2906
+ config;
2907
+ errorMsg = '';
2908
+ rowElement;
2909
+ cellElement;
2910
+ listeners = [];
2911
+ constructor(renderer, elementRef, util) {
2912
+ this.renderer = renderer;
2913
+ this.elementRef = elementRef;
2914
+ this.util = util;
2915
+ }
2916
+ onAcceptAll = () => {
2917
+ let entity = this.config.entity;
2918
+ let originalValues = entity.entityAspect.originalValues;
2919
+ for (const key in this.config.mergeData?.getAll()) {
2920
+ entity[key] = this.config.mergeData?.get(key).value;
2921
+ if (originalValues.hasOwnProperty(key))
2922
+ delete originalValues[key];
2923
+ }
2924
+ ;
2925
+ if (Object.keys(originalValues).length === 0 && originalValues.constructor === Object)
2926
+ entity.entityAspect.setUnchanged();
2927
+ entity.Merge_Data_Set.clearAll();
2928
+ entity.entityAspect.validateEntity();
2929
+ };
2930
+ onAccept = () => {
2931
+ let entity = this.config.entity;
2932
+ let originalValues = entity.entityAspect.originalValues;
2933
+ let propertyName = this.config.propertyName;
2934
+ entity[propertyName] = this.config.mergeData?.get(propertyName).value;
2935
+ this.config.mergeData?.clear(propertyName);
2936
+ if (originalValues.hasOwnProperty(propertyName) && (Object.keys(originalValues).length === 0 && originalValues.constructor === Object))
2937
+ delete originalValues[propertyName];
2938
+ if (this.config.mergeData?.isEmpty())
2939
+ entity.entityAspect.setUnchanged();
2940
+ entity.entityAspect.validateEntity();
2941
+ };
2942
+ onDecline = () => {
2943
+ let entity = this.config.entity;
2944
+ this.config.mergeData?.clearAll();
2945
+ entity.entityAspect.validateEntity();
2946
+ };
2947
+ ngOnInit() { }
2948
+ ngAfterViewInit() {
2949
+ this.rowElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-row');
2950
+ this.cellElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value');
2951
+ this.cellElement?.classList.add('invalid');
2952
+ this.errorMsg = this.config.errorMsg;
2953
+ this.listeners.push(this.renderer.listen(this.cellElement, 'mouseenter', (event) => {
2954
+ this.rowElement.style.zIndex = '10000000000';
2955
+ this.cellElement.classList.remove('hide');
2956
+ this.cellElement.classList.add('show');
2957
+ }));
2958
+ this.listeners.push(this.renderer.listen(this.cellElement, 'mouseleave', (event) => {
2959
+ this.rowElement.style.zIndex = 'auto';
2960
+ this.cellElement.classList.remove('show');
2961
+ this.cellElement.classList.add('hide');
2962
+ }));
2963
+ }
2964
+ ngOnDestroy() {
2965
+ this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value').classList.remove('invalid');
2966
+ this.listeners.forEach(l => l());
2967
+ }
2968
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialog, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: TruUtil }], target: i0.ɵɵFactoryTarget.Component });
2969
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruGridValidationDialog, selector: "tru-grid-validation-dialog", inputs: { config: "config" }, ngImport: i0, template: "<div class=\"invalid\">\r\n <i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n <div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n </div>\r\n</div>\r\n<span class=\"invalid-flag\"></span>\r\n", styles: ["::ng-deep .ag-row .ag-cell-value .invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px}::ng-deep .ag-row .ag-cell-value.hide .invalid{display:none!important}::ng-deep .ag-row .ag-cell-value.show .invalid{display:inline-block!important}::ng-deep .ag-row .ag-cell-value.invalid.show{overflow:visible!important}.invalid-flag{box-sizing:border-box;position:absolute;left:0;top:0;width:8px;height:8px;border-bottom:solid 4px transparent;border-right:solid 4px transparent;border-left:solid 4px red;border-top:solid 4px red}.invalid-triangle:after{box-sizing:border-box}::ng-deep .ag-row .ag-cell-value .invalid{background-color:#bd362f;margin:2px 0 0;padding:4px 10px;border-radius:3px!important;background-position:15px center;background-repeat:no-repeat;-ms-box-shadow:0 0 12px #999999;box-shadow:0 0 12px #999;color:#fff;-ms-opacity:.9;opacity:.9;z-index:1000}.merge-button{margin:5px;background-color:#fff}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:before{border-bottom-color:red!important}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:after{border-bottom-color:red!important}.invalid{font-family:Calibri,Helvetica,Arial,sans-serif!important}i{line-height:24px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2970
+ }
2971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialog, decorators: [{
2972
+ type: Component,
2973
+ args: [{ selector: 'tru-grid-validation-dialog', template: "<div class=\"invalid\">\r\n <i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n <div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n </div>\r\n</div>\r\n<span class=\"invalid-flag\"></span>\r\n", styles: ["::ng-deep .ag-row .ag-cell-value .invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px}::ng-deep .ag-row .ag-cell-value.hide .invalid{display:none!important}::ng-deep .ag-row .ag-cell-value.show .invalid{display:inline-block!important}::ng-deep .ag-row .ag-cell-value.invalid.show{overflow:visible!important}.invalid-flag{box-sizing:border-box;position:absolute;left:0;top:0;width:8px;height:8px;border-bottom:solid 4px transparent;border-right:solid 4px transparent;border-left:solid 4px red;border-top:solid 4px red}.invalid-triangle:after{box-sizing:border-box}::ng-deep .ag-row .ag-cell-value .invalid{background-color:#bd362f;margin:2px 0 0;padding:4px 10px;border-radius:3px!important;background-position:15px center;background-repeat:no-repeat;-ms-box-shadow:0 0 12px #999999;box-shadow:0 0 12px #999;color:#fff;-ms-opacity:.9;opacity:.9;z-index:1000}.merge-button{margin:5px;background-color:#fff}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:before{border-bottom-color:red!important}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:after{border-bottom-color:red!important}.invalid{font-family:Calibri,Helvetica,Arial,sans-serif!important}i{line-height:24px!important}\n"] }]
2974
+ }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: TruUtil }], propDecorators: { config: [{
2975
+ type: Input
2976
+ }] } });
2977
+
2781
2978
  class TruSearchResultViewManager {
2782
2979
  _searchViewToolbarTemplate;
2783
2980
  constructor() { }
@@ -3227,102 +3424,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
3227
3424
  type: Output
3228
3425
  }] } });
3229
3426
 
3230
- class TruUtil {
3231
- constructor() { }
3232
- tryParseInt = (str, defaultValue) => {
3233
- var retValue = defaultValue;
3234
- if (str !== null) {
3235
- if (str.length > 0) {
3236
- if (!isNaN(str)) {
3237
- retValue = parseInt(str);
3238
- }
3239
- }
3240
- }
3241
- return retValue;
3242
- };
3243
- tryParseBool(value, defaultValue) {
3244
- return (value == 'true' || value == 'false' || value === true || value === false) && JSON.parse(value) || defaultValue;
3245
- }
3246
- findClosestAncestorByClass = (element, cssSelector) => {
3247
- let firstChar = cssSelector.charAt(0);
3248
- for (; element; element = element.parentNode) {
3249
- if (firstChar === '.') {
3250
- if (element.classList && element.classList.contains(cssSelector.substr(1))) {
3251
- return element;
3252
- }
3253
- }
3254
- }
3255
- return null;
3256
- };
3257
- isNumeric = (n) => {
3258
- return !isNaN(parseFloat(n)) && isFinite(n);
3259
- };
3260
- removeNonNumericCharactersFromStr = (value) => {
3261
- return value.replace(/[^0-9]/g, '');
3262
- };
3263
- isDate = (date) => {
3264
- if (Object.prototype.toString.call(date) === '[object Date]') {
3265
- if (isNaN(date.getTime())) {
3266
- return false;
3267
- }
3268
- else {
3269
- return true;
3270
- }
3271
- }
3272
- else {
3273
- return false;
3274
- }
3275
- };
3276
- isValidDate = (value) => {
3277
- return !isNaN(Date.parse(value));
3278
- };
3279
- rulesEval = (styles) => {
3280
- let defaultStyles = {
3281
- 'backgroundColor': '#ffffff',
3282
- 'color': '#000000',
3283
- 'font-style': 'normal',
3284
- 'text-decoration': 'unset'
3285
- };
3286
- if (styles === null)
3287
- return defaultStyles;
3288
- if (Object.entries(styles).length !== 0) {
3289
- Object.assign(defaultStyles, styles);
3290
- return defaultStyles;
3291
- }
3292
- return defaultStyles;
3293
- };
3294
- /**
3295
- * Serializes an object as URL parameters. The object should be a base type or have
3296
- * properties that are each base types. Does not support a property with structure.
3297
- * @param {Object} data
3298
- * @returns {String}
3299
- */
3300
- formatAsUrlParameters = (data) => {
3301
- if (typeof data !== 'object' || data === null)
3302
- return (data == null ? '' : data.toString());
3303
- var buffer = [];
3304
- for (var name in data) {
3305
- if (!data.hasOwnProperty(name)) {
3306
- continue;
3307
- }
3308
- var value = data[name];
3309
- buffer.push(encodeURIComponent(name) +
3310
- '=' + encodeURIComponent(value == null ? '' : value));
3311
- }
3312
- var source = buffer.join('&')
3313
- .replace(/%20/g, '+');
3314
- return (source);
3315
- };
3316
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruUtil, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3317
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruUtil, providedIn: 'root' });
3318
- }
3319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruUtil, decorators: [{
3320
- type: Injectable,
3321
- args: [{
3322
- providedIn: 'root',
3323
- }]
3324
- }], ctorParameters: () => [] });
3325
-
3326
3427
  class TruMatSelectPanel {
3327
3428
  renderer;
3328
3429
  select;
@@ -3442,6 +3543,7 @@ class TruDataGrid {
3442
3543
  searchViewEventHandler;
3443
3544
  uiNotification;
3444
3545
  connectionHub;
3546
+ app;
3445
3547
  config;
3446
3548
  entity;
3447
3549
  name;
@@ -3490,13 +3592,14 @@ class TruDataGrid {
3490
3592
  parentToolbarTemplate = null;
3491
3593
  api;
3492
3594
  subs = [];
3493
- constructor(dataContext, searchResultViewManager, appEnvironment, searchViewEventHandler, uiNotification, connectionHub) {
3595
+ constructor(dataContext, searchResultViewManager, appEnvironment, searchViewEventHandler, uiNotification, connectionHub, app) {
3494
3596
  this.dataContext = dataContext;
3495
3597
  this.searchResultViewManager = searchResultViewManager;
3496
3598
  this.appEnvironment = appEnvironment;
3497
3599
  this.searchViewEventHandler = searchViewEventHandler;
3498
3600
  this.uiNotification = uiNotification;
3499
3601
  this.connectionHub = connectionHub;
3602
+ this.app = app;
3500
3603
  }
3501
3604
  enhanceRowDataForEntity = (entity) => {
3502
3605
  let rowData = this.config.resultConfig.rowDataEnhancer(entity);
@@ -3707,8 +3810,22 @@ class TruDataGrid {
3707
3810
  //}
3708
3811
  //this.gridOptions.api.setColumnDefs(columnDefs);
3709
3812
  }
3813
+ addValidationDialog = (config, hostElement) => {
3814
+ let component = createComponent(TruGridValidationDialog, {
3815
+ environmentInjector: this.app.injector,
3816
+ hostElement: hostElement,
3817
+ });
3818
+ component.instance.config = config;
3819
+ };
3710
3820
  onCellMouseOver(e) {
3711
- console.log(e); // 0
3821
+ let fieldName = e.api.colDef.field;
3822
+ let propertyConfig = e.api.data[fieldName];
3823
+ let cellElement = e.event.target;
3824
+ let rowEntity = e.data.$entity;
3825
+ if (cellElement.classList.contains('invalid')) {
3826
+ this.addValidationDialog(new TruGridValidationDialogConfig(rowEntity, fieldName, '', //this.parseErrorMessages(addedPropertyValdations),
3827
+ null), cellElement);
3828
+ }
3712
3829
  }
3713
3830
  onSearch = (setupQuery) => {
3714
3831
  this.firstSearchRan = true;
@@ -3807,13 +3924,13 @@ class TruDataGrid {
3807
3924
  ngOnDestroy() {
3808
3925
  this.subs.forEach(s => s.unsubscribe());
3809
3926
  }
3810
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruDataGrid, deps: [{ token: TruDataContext }, { token: TruSearchResultViewManager }, { token: TruAppEnvironment }, { token: TruSearchViewEventHandler }, { token: TruUiNotification }, { token: TruConnectionHub }], target: i0.ɵɵFactoryTarget.Component });
3927
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruDataGrid, deps: [{ token: TruDataContext }, { token: TruSearchResultViewManager }, { token: TruAppEnvironment }, { token: TruSearchViewEventHandler }, { token: TruUiNotification }, { token: TruConnectionHub }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Component });
3811
3928
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruDataGrid, selector: "tru-data-grid", inputs: { config: "config", entity: "entity", name: "name" }, host: { properties: { "class.tru-data-grid": "true" } }, usesOnChanges: true, ngImport: i0, template: "<div>\r\n <div class=\"tru-data-grid-toolbar-container\">\r\n <tru-toolbar>\r\n <tru-toolbar-dropdown [options]=\"unassociatedChoices\"\r\n [(selectedOption)]=\"selectedUnassociatedChoice\"\r\n (selectionChange)=\"onUnassociatedChoiceChanged($event)\"\r\n *ngIf=\"gridType == TruDataGridTypes.DetailManyToMany\">\r\n </tru-toolbar-dropdown>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-add-icon'\" [tooltip]=\"'Add - [Ctrl + I]'\" [disabled]=\"!canAdd()\" (onClick)=\"onAdd()\"></tru-toolbar-button>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-delete-icon'\" [tooltip]=\"'Delete - [Ctrl + D]'\" (click)=\"onDelete()\"></tru-toolbar-button>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-keep-icon'\" [tooltip]=\"'Keep selected records - [Ctrl + K]'\" (click)=\"onKeep()\"></tru-toolbar-button>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-remove-icon'\" [tooltip]=\"'Remove selected records - [Ctrl + R]'\" (click)=\"onRemove()\"></tru-toolbar-button>\r\n <tru-toolbar-separator></tru-toolbar-separator>\r\n <ng-container *ngTemplateOutlet=\"parentToolbarTemplate\"></ng-container>\r\n <tru-toolbar-separator *ngIf=\"gridType == TruDataGridTypes.Search\"></tru-toolbar-separator>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-export-icon'\" [tooltip]=\"'Export'\" (click)=\"onExport()\"></tru-toolbar-button>\r\n </tru-toolbar>\r\n </div>\r\n <div class=\"tru-data-grid-container\">\r\n <ag-grid-angular class=\"ag-theme-alpine\"\r\n [gridOptions]=\"gridOptions\"\r\n [rowData]=\"rowData\"\r\n [columnDefs]=\"columnDefs\"\r\n [defaultColDef]=\"defaultColDef\"\r\n [headerHeight]=\"25\"\r\n [rowHeight]=\"25\"\r\n [rowBuffer]=\"50\"\r\n [enterNavigatesVertically]=\"true\"\r\n [enterNavigatesVerticallyAfterEdit]=\"true\"\r\n [suppressRowHoverHighlight]=\"true\"\r\n [stopEditingWhenCellsLoseFocus]=\"false\"\r\n (cellDoubleClicked)=\"onCellDoubleClicked($event)\"\r\n (cellKeyDown)=\"onCellKeyDown($event)\"\r\n (cellFocused)=\"onCellFocused($event)\"\r\n (rowDataChanged)=\"onRowDataChanged($event)\"\r\n (cellMouseOver)=\"onCellMouseOver($event)\">\r\n </ag-grid-angular>\r\n </div>\r\n <div class=\"tru-data-grid-statusbar-container\">\r\n <div class=\"tru-data-grid-statusbar-container\">\r\n <div class=\"tru-data-grid-statusbar-values-container\">\r\n <p class=\"tru-data-grid-statusbar-values-text\">{{getRowCount()}}</p>\r\n <p class=\"tru-data-grid-statusbar-values-text\">{{getSelectedRowCount()}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".tru-data-grid:first-of-type+.tru-data-grid{margin-left:5px}.tru-data-grid-toolbar-container{display:inline-flex}.tru-data-grid-container{min-height:200px}.tru-data-grid-statusbar-container{position:absolute!important;left:0;right:0;bottom:0;height:23px;background:#006dcc;border-bottom-left-radius:0;border-bottom-right-radius:0;border-top:1px solid #e7e7e7}.tru-data-grid-statusbar-container p{float:left;color:#fff;font-weight:700;margin-left:10px;margin-top:0!important;line-height:23px}.detail-container .tru-data-grid{position:relative}.detail-container .mat-mdc-tab-body-content{height:100%;overflow:hidden!important}ag-grid-angular{position:absolute;inset:28px 0 23px;width:100%;height:100%}.ag-root-wrapper{border-top:0px!important}.ag-root{top:0;bottom:23px!important;height:calc(100% - 23px)}.ag-root.ag-layout-normal{height:calc(100% - 23px)!important}.ag-header-cell{padding-left:0!important;padding-right:0!important}.ag-header-cell-resize:after{top:unset!important;height:25px!important}.ag-header-row{font-weight:500!important}.ag-header-cell-label{justify-content:center}.ag-row .ag-cell-value{padding-left:2px!important;padding-right:2px!important}.ag-row .ag-cell-value.invalid{border:1px solid red!important;border-radius:0}.ag-row .ag-cell-value.ag-cell-inline-editing{padding-left:0!important}.ag-cell-inline-editing{height:24px!important}.ag-cell{border-right:solid #dde2eb 1px!important}.ag-has-focus .ag-cell-focus:not(.ag-cell-inline-editing):not(.invalid){border-right:solid #2196f3 1px!important}.ag-pinned-left-cols-container .ag-cell.ag-cell-focus{border:solid #dde2eb 1px!important;border-top:0px!important;border-bottom:0px!important}.ag-pinned-left-cols-container .ag-row-selected .ag-cell,.ag-pinned-left-cols-container .ag-row-focus .ag-cell{border:0px solid #dde2eb!important;border-right:2px solid #006dcc!important;color:#006dcc;font-weight:700;background-color:#ddd}.ag-header-cell.ag-column-focus{border:0px solid #dde2eb!important;border-bottom:2px solid #006dcc!important;color:#006dcc;font-weight:700;background-color:#ddd}.ag-pk-aligned-cell{text-align:center}.ag-horizontal-left-spacer{overflow:hidden}.ag-pinned-left-cols-container .ag-cell:hover{background-color:#2196f31a!important}.ag-root-wrapper-body.ag-layout-normal{margin-bottom:28px}.ag-popup-editor{background:#fff;padding:10px;border:solid 1px #006dcc}.ag-overlay-loading-center{border:none!important;box-shadow:none!important}.ag-grid-row-has-changes-gradient{background-color:#fff;filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#fff,endColorstr=#ffffff);background-image:linear-gradient(top,#fff 0%,#ffffff 25%,#dbffdf 100%);background-image:-ms-linear-gradient(top,#fff 0%,#ffffff 25%,#dbffdf 100%);background-image:-webkit-gradient(linear,right top,right bottom,color-stop(0%,#fff),color-stop(25%,#ffffff),color-stop(100%,#dbffdf))}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.spin{animation-name:spin;animation-duration:4s;animation-iteration-count:infinite;animation-timing-function:linear}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i8.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "suppressMenuHide", "enableBrowserTooltips", "tooltipTrigger", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "tooltipInteraction", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "suppressCutToClipboard", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "dataTypeDefinitions", "maintainColumnOrder", "suppressFieldDotNotation", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "autoSizeStrategy", "components", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterMovesDown", "enterMovesDownAfterEdit", "enterNavigatesVertically", "enterNavigatesVerticallyAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "quickFilterText", "cacheQuickFilter", "excludeHiddenColumnsFromQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "excludeChildrenWhenTreeDataFiltering", "enableAdvancedFilter", "advancedFilterModel", "includeHiddenColumnsInAdvancedFilter", "advancedFilterParent", "advancedFilterBuilderParams", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "enableChartToolPanelsButton", "suppressChartToolPanelsButton", "chartToolPanelsDef", "loadingCellRenderer", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressParentsInRowNodes", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "alwaysAggregateAtRootLevel", "suppressAggAtRootLevel", "aggregateOnlyChangedColumns", "suppressAggFilteredOnly", "removePivotHeaderRowWhenSingleValueColumn", "animateRows", "enableCellChangeFlash", "cellFlashDelay", "cellFadeDelay", "allowShowChangeAfterFilter", "domLayout", "ensureDomOrder", "enableRtl", "suppressColumnVirtualisation", "suppressMaxRenderedRowRestriction", "suppressRowVirtualisation", "rowDragManaged", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragEntireRow", "rowDragMultiRow", "rowDragText", "fullWidthCellRenderer", "fullWidthCellRendererParams", "embedFullWidthRows", "suppressGroupMaintainValueType", "groupDisplayType", "groupDefaultExpanded", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupLockGroupColumns", "groupAggFiltering", "groupIncludeFooter", "groupIncludeTotalFooter", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "groupAllowUnbalanced", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererParams", "suppressMakeColumnVisibleAfterUnGroup", "treeData", "rowGroupPanelSuppressSort", "suppressGroupRowsSticky", "pinnedTopRowData", "pinnedBottomRowData", "rowModelType", "rowData", "asyncTransactionWaitMillis", "suppressModelUpdateAfterUpdateTransaction", "datasource", "cacheOverflowSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "suppressServerSideInfiniteScroll", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideOnlyRefreshFilteredGroups", "serverSideFilterAllLevels", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSidePivotResultFieldSeparator", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellFocus", "suppressMultiRangeSelection", "enableCellTextSelection", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "fillHandleDirection", "suppressClearOnFillReduction", "sortingOrder", "accentedSort", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "multiSortKey", "suppressMaintainUnsortedOrder", "icons", "rowHeight", "rowStyle", "rowClass", "rowClassRules", "suppressRowHoverHighlight", "suppressRowTransform", "columnHoverHighlight", "gridId", "deltaSort", "treeDataDisplayType", "functionsPassive", "enableGroupEdit", "initialState", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "getLocaleText", "getDocument", "paginationNumberFormatter", "getGroupRowAgg", "isGroupOpenByDefault", "initialGroupOrderComparator", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "getChildCount", "getServerSideGroupLevelParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowId", "resetRowDataOnUpdate", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthRow"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "cutStart", "cutEnd", "pasteStart", "pasteEnd", "columnVisible", "columnPinned", "columnResized", "columnMoved", "columnValueChanged", "columnPivotModeChanged", "columnPivotChanged", "columnGroupOpened", "newColumnsLoaded", "gridColumnsChanged", "displayedColumnsChanged", "virtualColumnsChanged", "columnEverythingChanged", "componentStateChanged", "cellValueChanged", "cellEditRequest", "rowValueChanged", "cellEditingStarted", "cellEditingStopped", "rowEditingStarted", "rowEditingStopped", "undoStarted", "undoEnded", "redoStarted", "redoEnded", "rangeDeleteStart", "rangeDeleteEnd", "filterOpened", "filterChanged", "filterModified", "advancedFilterBuilderVisibleChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "gridReady", "gridPreDestroyed", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "stateUpdated", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pinnedRowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "storeRefreshed", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "tooltipShow", "tooltipHide", "sortChanged", "columnRowGroupChangeRequest", "columnPivotChangeRequest", "columnValueChangeRequest", "columnAggFuncChangeRequest"] }, { kind: "component", type: TruToolbar, selector: "tru-toolbar", inputs: ["config"] }, { kind: "component", type: TruToolbarButton, selector: "tru-toolbar-button", inputs: ["config", "icon", "text", "disabled", "tooltip", "type"], outputs: ["onClick", "onKeydown"] }, { kind: "component", type: TruToolbarDropdown, selector: "tru-toolbar-dropdown", inputs: ["config", "options", "selectedOption", "disabled"], outputs: ["selectedOptionChange", "selectionChange"] }, { kind: "component", type: TruToolbarSeparator, selector: "tru-toolbar-separator" }], encapsulation: i0.ViewEncapsulation.None });
3812
3929
  }
3813
3930
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruDataGrid, decorators: [{
3814
3931
  type: Component,
3815
3932
  args: [{ selector: 'tru-data-grid', encapsulation: ViewEncapsulation.None, host: { '[class.tru-data-grid]': 'true' }, template: "<div>\r\n <div class=\"tru-data-grid-toolbar-container\">\r\n <tru-toolbar>\r\n <tru-toolbar-dropdown [options]=\"unassociatedChoices\"\r\n [(selectedOption)]=\"selectedUnassociatedChoice\"\r\n (selectionChange)=\"onUnassociatedChoiceChanged($event)\"\r\n *ngIf=\"gridType == TruDataGridTypes.DetailManyToMany\">\r\n </tru-toolbar-dropdown>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-add-icon'\" [tooltip]=\"'Add - [Ctrl + I]'\" [disabled]=\"!canAdd()\" (onClick)=\"onAdd()\"></tru-toolbar-button>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-delete-icon'\" [tooltip]=\"'Delete - [Ctrl + D]'\" (click)=\"onDelete()\"></tru-toolbar-button>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-keep-icon'\" [tooltip]=\"'Keep selected records - [Ctrl + K]'\" (click)=\"onKeep()\"></tru-toolbar-button>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-remove-icon'\" [tooltip]=\"'Remove selected records - [Ctrl + R]'\" (click)=\"onRemove()\"></tru-toolbar-button>\r\n <tru-toolbar-separator></tru-toolbar-separator>\r\n <ng-container *ngTemplateOutlet=\"parentToolbarTemplate\"></ng-container>\r\n <tru-toolbar-separator *ngIf=\"gridType == TruDataGridTypes.Search\"></tru-toolbar-separator>\r\n <tru-toolbar-button [icon]=\"'tru-toolbar-export-icon'\" [tooltip]=\"'Export'\" (click)=\"onExport()\"></tru-toolbar-button>\r\n </tru-toolbar>\r\n </div>\r\n <div class=\"tru-data-grid-container\">\r\n <ag-grid-angular class=\"ag-theme-alpine\"\r\n [gridOptions]=\"gridOptions\"\r\n [rowData]=\"rowData\"\r\n [columnDefs]=\"columnDefs\"\r\n [defaultColDef]=\"defaultColDef\"\r\n [headerHeight]=\"25\"\r\n [rowHeight]=\"25\"\r\n [rowBuffer]=\"50\"\r\n [enterNavigatesVertically]=\"true\"\r\n [enterNavigatesVerticallyAfterEdit]=\"true\"\r\n [suppressRowHoverHighlight]=\"true\"\r\n [stopEditingWhenCellsLoseFocus]=\"false\"\r\n (cellDoubleClicked)=\"onCellDoubleClicked($event)\"\r\n (cellKeyDown)=\"onCellKeyDown($event)\"\r\n (cellFocused)=\"onCellFocused($event)\"\r\n (rowDataChanged)=\"onRowDataChanged($event)\"\r\n (cellMouseOver)=\"onCellMouseOver($event)\">\r\n </ag-grid-angular>\r\n </div>\r\n <div class=\"tru-data-grid-statusbar-container\">\r\n <div class=\"tru-data-grid-statusbar-container\">\r\n <div class=\"tru-data-grid-statusbar-values-container\">\r\n <p class=\"tru-data-grid-statusbar-values-text\">{{getRowCount()}}</p>\r\n <p class=\"tru-data-grid-statusbar-values-text\">{{getSelectedRowCount()}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".tru-data-grid:first-of-type+.tru-data-grid{margin-left:5px}.tru-data-grid-toolbar-container{display:inline-flex}.tru-data-grid-container{min-height:200px}.tru-data-grid-statusbar-container{position:absolute!important;left:0;right:0;bottom:0;height:23px;background:#006dcc;border-bottom-left-radius:0;border-bottom-right-radius:0;border-top:1px solid #e7e7e7}.tru-data-grid-statusbar-container p{float:left;color:#fff;font-weight:700;margin-left:10px;margin-top:0!important;line-height:23px}.detail-container .tru-data-grid{position:relative}.detail-container .mat-mdc-tab-body-content{height:100%;overflow:hidden!important}ag-grid-angular{position:absolute;inset:28px 0 23px;width:100%;height:100%}.ag-root-wrapper{border-top:0px!important}.ag-root{top:0;bottom:23px!important;height:calc(100% - 23px)}.ag-root.ag-layout-normal{height:calc(100% - 23px)!important}.ag-header-cell{padding-left:0!important;padding-right:0!important}.ag-header-cell-resize:after{top:unset!important;height:25px!important}.ag-header-row{font-weight:500!important}.ag-header-cell-label{justify-content:center}.ag-row .ag-cell-value{padding-left:2px!important;padding-right:2px!important}.ag-row .ag-cell-value.invalid{border:1px solid red!important;border-radius:0}.ag-row .ag-cell-value.ag-cell-inline-editing{padding-left:0!important}.ag-cell-inline-editing{height:24px!important}.ag-cell{border-right:solid #dde2eb 1px!important}.ag-has-focus .ag-cell-focus:not(.ag-cell-inline-editing):not(.invalid){border-right:solid #2196f3 1px!important}.ag-pinned-left-cols-container .ag-cell.ag-cell-focus{border:solid #dde2eb 1px!important;border-top:0px!important;border-bottom:0px!important}.ag-pinned-left-cols-container .ag-row-selected .ag-cell,.ag-pinned-left-cols-container .ag-row-focus .ag-cell{border:0px solid #dde2eb!important;border-right:2px solid #006dcc!important;color:#006dcc;font-weight:700;background-color:#ddd}.ag-header-cell.ag-column-focus{border:0px solid #dde2eb!important;border-bottom:2px solid #006dcc!important;color:#006dcc;font-weight:700;background-color:#ddd}.ag-pk-aligned-cell{text-align:center}.ag-horizontal-left-spacer{overflow:hidden}.ag-pinned-left-cols-container .ag-cell:hover{background-color:#2196f31a!important}.ag-root-wrapper-body.ag-layout-normal{margin-bottom:28px}.ag-popup-editor{background:#fff;padding:10px;border:solid 1px #006dcc}.ag-overlay-loading-center{border:none!important;box-shadow:none!important}.ag-grid-row-has-changes-gradient{background-color:#fff;filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#fff,endColorstr=#ffffff);background-image:linear-gradient(top,#fff 0%,#ffffff 25%,#dbffdf 100%);background-image:-ms-linear-gradient(top,#fff 0%,#ffffff 25%,#dbffdf 100%);background-image:-webkit-gradient(linear,right top,right bottom,color-stop(0%,#fff),color-stop(25%,#ffffff),color-stop(100%,#dbffdf))}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.spin{animation-name:spin;animation-duration:4s;animation-iteration-count:infinite;animation-timing-function:linear}\n"] }]
3816
- }], ctorParameters: () => [{ type: TruDataContext }, { type: TruSearchResultViewManager }, { type: TruAppEnvironment }, { type: TruSearchViewEventHandler }, { type: TruUiNotification }, { type: TruConnectionHub }], propDecorators: { config: [{
3933
+ }], ctorParameters: () => [{ type: TruDataContext }, { type: TruSearchResultViewManager }, { type: TruAppEnvironment }, { type: TruSearchViewEventHandler }, { type: TruUiNotification }, { type: TruConnectionHub }, { type: i0.ApplicationRef }], propDecorators: { config: [{
3817
3934
  type: Input
3818
3935
  }], entity: [{
3819
3936
  type: Input
@@ -6310,82 +6427,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
6310
6427
  }]
6311
6428
  }] });
6312
6429
 
6313
- class TruGridValidationDialog {
6314
- renderer;
6315
- elementRef;
6316
- util;
6317
- config;
6318
- errorMsg = '';
6319
- rowElement;
6320
- cellElement;
6321
- listeners = [];
6322
- constructor(renderer, elementRef, util) {
6323
- this.renderer = renderer;
6324
- this.elementRef = elementRef;
6325
- this.util = util;
6326
- }
6327
- onAcceptAll = () => {
6328
- let entity = this.config.entity;
6329
- let originalValues = entity.entityAspect.originalValues;
6330
- for (const key in this.config.mergeData?.getAll()) {
6331
- entity[key] = this.config.mergeData?.get(key).value;
6332
- if (originalValues.hasOwnProperty(key))
6333
- delete originalValues[key];
6334
- }
6335
- ;
6336
- if (Object.keys(originalValues).length === 0 && originalValues.constructor === Object)
6337
- entity.entityAspect.setUnchanged();
6338
- entity.Merge_Data_Set.clearAll();
6339
- entity.entityAspect.validateEntity();
6340
- };
6341
- onAccept = () => {
6342
- let entity = this.config.entity;
6343
- let originalValues = entity.entityAspect.originalValues;
6344
- let propertyName = this.config.propertyName;
6345
- entity[propertyName] = this.config.mergeData?.get(propertyName).value;
6346
- this.config.mergeData?.clear(propertyName);
6347
- if (originalValues.hasOwnProperty(propertyName) && (Object.keys(originalValues).length === 0 && originalValues.constructor === Object))
6348
- delete originalValues[propertyName];
6349
- if (this.config.mergeData?.isEmpty())
6350
- entity.entityAspect.setUnchanged();
6351
- entity.entityAspect.validateEntity();
6352
- };
6353
- onDecline = () => {
6354
- let entity = this.config.entity;
6355
- this.config.mergeData?.clearAll();
6356
- entity.entityAspect.validateEntity();
6357
- };
6358
- ngOnInit() { }
6359
- ngAfterViewInit() {
6360
- this.rowElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-row');
6361
- this.cellElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value');
6362
- this.cellElement?.classList.add('invalid');
6363
- this.errorMsg = this.config.errorMsg;
6364
- this.listeners.push(this.renderer.listen(this.cellElement, 'mouseenter', (event) => {
6365
- this.rowElement.style.zIndex = '10000000000';
6366
- this.cellElement.classList.remove('hide');
6367
- this.cellElement.classList.add('show');
6368
- }));
6369
- this.listeners.push(this.renderer.listen(this.cellElement, 'mouseleave', (event) => {
6370
- this.rowElement.style.zIndex = 'auto';
6371
- this.cellElement.classList.remove('show');
6372
- this.cellElement.classList.add('hide');
6373
- }));
6374
- }
6375
- ngOnDestroy() {
6376
- this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value').classList.remove('invalid');
6377
- this.listeners.forEach(l => l());
6378
- }
6379
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialog, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: TruUtil }], target: i0.ɵɵFactoryTarget.Component });
6380
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruGridValidationDialog, selector: "tru-grid-validation-dialog", inputs: { config: "config" }, ngImport: i0, template: "<div class=\"invalid\">\r\n <i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n <div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n </div>\r\n</div>\r\n<span class=\"invalid-flag\"></span>\r\n", styles: ["::ng-deep .ag-row .ag-cell-value .invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px}::ng-deep .ag-row .ag-cell-value.hide .invalid{display:none!important}::ng-deep .ag-row .ag-cell-value.show .invalid{display:inline-block!important}::ng-deep .ag-row .ag-cell-value.invalid.show{overflow:visible!important}.invalid-flag{box-sizing:border-box;position:absolute;left:0;top:0;width:8px;height:8px;border-bottom:solid 4px transparent;border-right:solid 4px transparent;border-left:solid 4px red;border-top:solid 4px red}.invalid-triangle:after{box-sizing:border-box}::ng-deep .ag-row .ag-cell-value .invalid{background-color:#bd362f;margin:2px 0 0;padding:4px 10px;border-radius:3px!important;background-position:15px center;background-repeat:no-repeat;-ms-box-shadow:0 0 12px #999999;box-shadow:0 0 12px #999;color:#fff;-ms-opacity:.9;opacity:.9;z-index:1000}.merge-button{margin:5px;background-color:#fff}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:before{border-bottom-color:red!important}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:after{border-bottom-color:red!important}.invalid{font-family:Calibri,Helvetica,Arial,sans-serif!important}i{line-height:24px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
6381
- }
6382
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialog, decorators: [{
6383
- type: Component,
6384
- args: [{ selector: 'tru-grid-validation-dialog', template: "<div class=\"invalid\">\r\n <i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n <div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n </div>\r\n</div>\r\n<span class=\"invalid-flag\"></span>\r\n", styles: ["::ng-deep .ag-row .ag-cell-value .invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px}::ng-deep .ag-row .ag-cell-value.hide .invalid{display:none!important}::ng-deep .ag-row .ag-cell-value.show .invalid{display:inline-block!important}::ng-deep .ag-row .ag-cell-value.invalid.show{overflow:visible!important}.invalid-flag{box-sizing:border-box;position:absolute;left:0;top:0;width:8px;height:8px;border-bottom:solid 4px transparent;border-right:solid 4px transparent;border-left:solid 4px red;border-top:solid 4px red}.invalid-triangle:after{box-sizing:border-box}::ng-deep .ag-row .ag-cell-value .invalid{background-color:#bd362f;margin:2px 0 0;padding:4px 10px;border-radius:3px!important;background-position:15px center;background-repeat:no-repeat;-ms-box-shadow:0 0 12px #999999;box-shadow:0 0 12px #999;color:#fff;-ms-opacity:.9;opacity:.9;z-index:1000}.merge-button{margin:5px;background-color:#fff}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:before{border-bottom-color:red!important}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:after{border-bottom-color:red!important}.invalid{font-family:Calibri,Helvetica,Arial,sans-serif!important}i{line-height:24px!important}\n"] }]
6385
- }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: TruUtil }], propDecorators: { config: [{
6386
- type: Input
6387
- }] } });
6388
-
6389
6430
  class TruGridValidationDialogModule {
6390
6431
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6391
6432
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialogModule, declarations: [TruGridValidationDialog], imports: [CommonModule, FormsModule], exports: [TruGridValidationDialog] });
@@ -6837,31 +6878,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
6837
6878
  }]
6838
6879
  }] });
6839
6880
 
6840
- class TruGridValidationDialogConfig {
6841
- _entity;
6842
- _propertyName;
6843
- _errorMsg;
6844
- _mergeData;
6845
- get entity() {
6846
- return this._entity;
6847
- }
6848
- get propertyName() {
6849
- return this._propertyName;
6850
- }
6851
- get errorMsg() {
6852
- return this._errorMsg;
6853
- }
6854
- get mergeData() {
6855
- return this._mergeData;
6856
- }
6857
- constructor(entity, propertyName, errorMsg, mergeData = null) {
6858
- this._entity = entity;
6859
- this._propertyName = propertyName;
6860
- this._errorMsg = errorMsg;
6861
- this._mergeData = mergeData;
6862
- }
6863
- }
6864
-
6865
6881
  class TruValidationDialogConfig {
6866
6882
  _entity;
6867
6883
  _propertyName;