@trudb/tru-common-lib 0.0.971 → 0.0.973
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.
- package/esm2022/lib/components/data-grid/classes/tru-data-grid-cell-renderer.mjs +22 -0
- package/esm2022/lib/components/data-grid/tru-data-grid.mjs +11 -7
- package/esm2022/lib/components/validation-dialog/tru-validation-dialog.mjs +3 -3
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/trudb-tru-common-lib.mjs +60 -33
- package/fesm2022/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/components/data-grid/classes/tru-data-grid-cell-renderer.d.ts +7 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -2661,6 +2661,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
|
|
|
2661
2661
|
}]
|
|
2662
2662
|
}] });
|
|
2663
2663
|
|
|
2664
|
+
class TruDataGridCellRenderer {
|
|
2665
|
+
// private eGui: is an empty element to satisfy the getGui method.
|
|
2666
|
+
eGui;
|
|
2667
|
+
init(props) {
|
|
2668
|
+
var content = document.createTextNode(props.value);
|
|
2669
|
+
props.eGridCell.appendChild(content);
|
|
2670
|
+
let validationContainer = document.createElement('div');
|
|
2671
|
+
validationContainer.className = 'invalid hide';
|
|
2672
|
+
let validationFlag = document.createElement('span');
|
|
2673
|
+
validationFlag.className = 'invalid-flag';
|
|
2674
|
+
props.eGridCell.appendChild(validationContainer);
|
|
2675
|
+
props.eGridCell.appendChild(validationFlag);
|
|
2676
|
+
}
|
|
2677
|
+
getGui() {
|
|
2678
|
+
return this.eGui;
|
|
2679
|
+
}
|
|
2680
|
+
refresh() {
|
|
2681
|
+
return false;
|
|
2682
|
+
}
|
|
2683
|
+
destroy() { }
|
|
2684
|
+
}
|
|
2685
|
+
|
|
2664
2686
|
var TruDataGridTypes;
|
|
2665
2687
|
(function (TruDataGridTypes) {
|
|
2666
2688
|
TruDataGridTypes[TruDataGridTypes["Search"] = 0] = "Search";
|
|
@@ -2778,31 +2800,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
|
|
|
2778
2800
|
}]
|
|
2779
2801
|
}] });
|
|
2780
2802
|
|
|
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
2803
|
class TruUtil {
|
|
2807
2804
|
constructor() { }
|
|
2808
2805
|
tryParseInt = (str, defaultValue) => {
|
|
@@ -3858,11 +3855,16 @@ class TruDataGrid {
|
|
|
3858
3855
|
onCellMouseOver(e) {
|
|
3859
3856
|
let cellElement = e.event.target;
|
|
3860
3857
|
if (cellElement.classList.contains('invalid')) {
|
|
3861
|
-
let fieldName = e.colDef.field;
|
|
3862
|
-
let propertyConfig = e.data[fieldName];
|
|
3863
|
-
let entityToValidate = e.data.$entity;
|
|
3864
|
-
let validationErrors = entityToValidate.entityAspect.getValidationErrors();
|
|
3865
|
-
this.addValidationDialog(new TruGridValidationDialogConfig(
|
|
3858
|
+
//let fieldName = e.colDef.field;
|
|
3859
|
+
//let propertyConfig = e.data[fieldName];
|
|
3860
|
+
//let entityToValidate = e.data.$entity;
|
|
3861
|
+
//let validationErrors = entityToValidate.entityAspect.getValidationErrors();
|
|
3862
|
+
//this.addValidationDialog(new TruGridValidationDialogConfig(
|
|
3863
|
+
// entityToValidate,
|
|
3864
|
+
// fieldName,
|
|
3865
|
+
// this.parseErrorMessages(validationErrors),
|
|
3866
|
+
// this.getMergeData(propertyConfig, entityToValidate)
|
|
3867
|
+
//), cellElement);
|
|
3866
3868
|
}
|
|
3867
3869
|
}
|
|
3868
3870
|
onCellMouseOut(e) {
|
|
@@ -6897,11 +6899,11 @@ class TruValidationDialog {
|
|
|
6897
6899
|
this.listeners.forEach(l => l());
|
|
6898
6900
|
}
|
|
6899
6901
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruValidationDialog, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: TruUtil }], target: i0.ɵɵFactoryTarget.Component });
|
|
6900
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruValidationDialog, selector: "tru-validation-dialog", inputs: { config: "config" }, ngImport: i0, template: "<
|
|
6902
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruValidationDialog, selector: "tru-validation-dialog", inputs: { config: "config" }, ngImport: i0, template: "<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", styles: [".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!important}.invalid.hide{display:none!important}.invalid.show{display:inline-block!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}.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"] }] });
|
|
6901
6903
|
}
|
|
6902
6904
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruValidationDialog, decorators: [{
|
|
6903
6905
|
type: Component,
|
|
6904
|
-
args: [{ selector: 'tru-validation-dialog', template: "<
|
|
6906
|
+
args: [{ selector: 'tru-validation-dialog', template: "<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", styles: [".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!important}.invalid.hide{display:none!important}.invalid.show{display:inline-block!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}.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"] }]
|
|
6905
6907
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: TruUtil }], propDecorators: { config: [{
|
|
6906
6908
|
type: Input
|
|
6907
6909
|
}] } });
|
|
@@ -6920,6 +6922,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
|
|
|
6920
6922
|
}]
|
|
6921
6923
|
}] });
|
|
6922
6924
|
|
|
6925
|
+
class TruGridValidationDialogConfig {
|
|
6926
|
+
_entity;
|
|
6927
|
+
_propertyName;
|
|
6928
|
+
_errorMsg;
|
|
6929
|
+
_mergeData;
|
|
6930
|
+
get entity() {
|
|
6931
|
+
return this._entity;
|
|
6932
|
+
}
|
|
6933
|
+
get propertyName() {
|
|
6934
|
+
return this._propertyName;
|
|
6935
|
+
}
|
|
6936
|
+
get errorMsg() {
|
|
6937
|
+
return this._errorMsg;
|
|
6938
|
+
}
|
|
6939
|
+
get mergeData() {
|
|
6940
|
+
return this._mergeData;
|
|
6941
|
+
}
|
|
6942
|
+
constructor(entity, propertyName, errorMsg, mergeData = null) {
|
|
6943
|
+
this._entity = entity;
|
|
6944
|
+
this._propertyName = propertyName;
|
|
6945
|
+
this._errorMsg = errorMsg;
|
|
6946
|
+
this._mergeData = mergeData;
|
|
6947
|
+
}
|
|
6948
|
+
}
|
|
6949
|
+
|
|
6923
6950
|
class TruValidationDialogConfig {
|
|
6924
6951
|
_entity;
|
|
6925
6952
|
_propertyName;
|
|
@@ -7796,5 +7823,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
|
|
|
7796
7823
|
* Generated bundle index. Do not edit.
|
|
7797
7824
|
*/
|
|
7798
7825
|
|
|
7799
|
-
export { DetailViewModule, TruAppEnvironment, TruAuth, TruAuthInterceptor, TruBreezeContext, TruBreezeContextFactory, TruBreezeGridValidator, TruBreezeGridValidatorModule, TruBreezeMetadataProvider, TruBreezeValidator, TruBreezeValidatorModule, TruChoice, TruCloudFileManager, TruColumn, TruColumnModule, TruCommonModule, TruComponentConfigBase, TruComponentLookup, TruConfirmDialog, TruConfirmDialogConfig, TruConfirmDialogModule, TruConnectionHub, TruContextFilter, TruContextFilterChoice, TruContextFilters, TruControlComponentConfigBase, TruDataChange, TruDataContext, TruDataGrid, TruDataGridModule, TruDataGridTypes, TruDataGridUtil, TruDesktop, TruDesktopManager, TruDesktopModule, TruDesktopViewConfig, TruDetailViewBase, TruEditControlBase, TruEditControlConfigBase, TruEditParentControlConfigBase, TruEditPkeyControlConfigBase, TruEntityAccessor, TruEntityBase, TruExportDialog, TruExportDialogConfig, TruExportDialogModule, TruForm, TruFormModule, TruFormulaEval, TruGridValidationDialog, TruGridValidationDialogModule, TruGroupBox, TruGroupBoxModule, TruIconModule, TruListControlConfigBase, TruLogin, TruLoginModule, TruMatSelectPanel, TruMatSelectPanelModule, TruModelPropertyLookup, TruModelTypeLookup, TruNameValue, TruPasswordDialog, TruPasswordDialogModule, TruPredicate, TruPredicateMap, TruPropertyConfigBase, TruPropertyConfigCloudFile, TruPropertyConfigDate, TruPropertyConfigDecimal, TruPropertyConfigFile, TruPropertyConfigForeignKey, TruPropertyConfigInteger, TruPropertyConfigPassword, TruPropertyConfigPercentage, TruPropertyConfigScientific, TruPropertyConfigText, TruPropertyConfigTextChoices, TruPropertyConfigUsaAddress, TruPropertyConfigZipCode, TruQueryPredicateManager, TruRow, TruRowModule, TruSearchConfigBase, TruSearchControlBase, TruSearchControlConfigBase, TruSearchControlRangeBase, TruSearchIconModule, TruSearchPanelPositionManager, TruSearchPanelPositionManagerModule, TruSearchResultViewBase, TruSearchResultViewBaseModule, TruSearchResultViewManager, TruSearchViewBase, TruSearchViewBaseModule, TruSearchViewControlEventHandler, TruSearchViewEventHandler, TruSort, TruTableConfigBase, TruTableRegistry, TruTextManager, TruToolbar, TruToolbarButton, TruToolbarButtonModule, TruToolbarContextFilter, TruToolbarContextFilterModule, TruToolbarDropdown, TruToolbarDropdownModule, TruToolbarMenu, TruToolbarMenuModule, TruToolbarModule, TruToolbarSeparator, TruToolbarSeparatorModule, TruToolbarText, TruToolbarTextModule, TruToolbarUserProfile, TruToolbarUserProfileModule, TruUiNotification, TruUser, TruUtil, TruValidationDialog, TruValidationDialogModule, TruValidatorFactory, TruWindowActionEventHandler, TruWindowEventArgs, TruWindowEventHandler };
|
|
7826
|
+
export { DetailViewModule, TruAppEnvironment, TruAuth, TruAuthInterceptor, TruBreezeContext, TruBreezeContextFactory, TruBreezeGridValidator, TruBreezeGridValidatorModule, TruBreezeMetadataProvider, TruBreezeValidator, TruBreezeValidatorModule, TruChoice, TruCloudFileManager, TruColumn, TruColumnModule, TruCommonModule, TruComponentConfigBase, TruComponentLookup, TruConfirmDialog, TruConfirmDialogConfig, TruConfirmDialogModule, TruConnectionHub, TruContextFilter, TruContextFilterChoice, TruContextFilters, TruControlComponentConfigBase, TruDataChange, TruDataContext, TruDataGrid, TruDataGridCellRenderer, TruDataGridModule, TruDataGridTypes, TruDataGridUtil, TruDesktop, TruDesktopManager, TruDesktopModule, TruDesktopViewConfig, TruDetailViewBase, TruEditControlBase, TruEditControlConfigBase, TruEditParentControlConfigBase, TruEditPkeyControlConfigBase, TruEntityAccessor, TruEntityBase, TruExportDialog, TruExportDialogConfig, TruExportDialogModule, TruForm, TruFormModule, TruFormulaEval, TruGridValidationDialog, TruGridValidationDialogModule, TruGroupBox, TruGroupBoxModule, TruIconModule, TruListControlConfigBase, TruLogin, TruLoginModule, TruMatSelectPanel, TruMatSelectPanelModule, TruModelPropertyLookup, TruModelTypeLookup, TruNameValue, TruPasswordDialog, TruPasswordDialogModule, TruPredicate, TruPredicateMap, TruPropertyConfigBase, TruPropertyConfigCloudFile, TruPropertyConfigDate, TruPropertyConfigDecimal, TruPropertyConfigFile, TruPropertyConfigForeignKey, TruPropertyConfigInteger, TruPropertyConfigPassword, TruPropertyConfigPercentage, TruPropertyConfigScientific, TruPropertyConfigText, TruPropertyConfigTextChoices, TruPropertyConfigUsaAddress, TruPropertyConfigZipCode, TruQueryPredicateManager, TruRow, TruRowModule, TruSearchConfigBase, TruSearchControlBase, TruSearchControlConfigBase, TruSearchControlRangeBase, TruSearchIconModule, TruSearchPanelPositionManager, TruSearchPanelPositionManagerModule, TruSearchResultViewBase, TruSearchResultViewBaseModule, TruSearchResultViewManager, TruSearchViewBase, TruSearchViewBaseModule, TruSearchViewControlEventHandler, TruSearchViewEventHandler, TruSort, TruTableConfigBase, TruTableRegistry, TruTextManager, TruToolbar, TruToolbarButton, TruToolbarButtonModule, TruToolbarContextFilter, TruToolbarContextFilterModule, TruToolbarDropdown, TruToolbarDropdownModule, TruToolbarMenu, TruToolbarMenuModule, TruToolbarModule, TruToolbarSeparator, TruToolbarSeparatorModule, TruToolbarText, TruToolbarTextModule, TruToolbarUserProfile, TruToolbarUserProfileModule, TruUiNotification, TruUser, TruUtil, TruValidationDialog, TruValidationDialogModule, TruValidatorFactory, TruWindowActionEventHandler, TruWindowEventArgs, TruWindowEventHandler };
|
|
7800
7827
|
//# sourceMappingURL=trudb-tru-common-lib.mjs.map
|