@trudb/tru-common-lib 0.0.186 → 0.0.187
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/esm2020/lib/base-classes/tru-component-config-base.mjs +4 -0
- package/esm2020/lib/base-classes/tru-control-component-config-base.mjs +4 -0
- package/esm2020/lib/base-classes/tru-search-config-base.mjs +4 -0
- package/esm2020/lib/components/desktop/services/tru-desktop-manager.mjs +81 -0
- package/esm2020/public-api.mjs +5 -1
- package/fesm2015/trudb-tru-common-lib.mjs +113 -24
- package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
- package/fesm2020/trudb-tru-common-lib.mjs +113 -24
- package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/base-classes/tru-component-config-base.d.ts +3 -0
- package/lib/base-classes/tru-control-component-config-base.d.ts +19 -0
- package/lib/base-classes/tru-search-config-base.d.ts +9 -0
- package/lib/components/desktop/services/tru-desktop-manager.d.ts +29 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
|
@@ -30,6 +30,14 @@ import * as i1$4 from '@angular/platform-browser';
|
|
|
30
30
|
import { BrowserModule } from '@angular/platform-browser';
|
|
31
31
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
32
32
|
|
|
33
|
+
class TruComponentConfigBase {
|
|
34
|
+
constructor() { }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
class TruControlComponentConfigBase {
|
|
38
|
+
constructor() { }
|
|
39
|
+
}
|
|
40
|
+
|
|
33
41
|
class TruEntityBase {
|
|
34
42
|
constructor(...args) {
|
|
35
43
|
this.entityAspect = new EntityAspect();
|
|
@@ -103,6 +111,10 @@ class TruSearchComponentConfigBase {
|
|
|
103
111
|
constructor() { }
|
|
104
112
|
}
|
|
105
113
|
|
|
114
|
+
class TruSearchConfigBase {
|
|
115
|
+
constructor() { }
|
|
116
|
+
}
|
|
117
|
+
|
|
106
118
|
class TruTableConfigBase {
|
|
107
119
|
constructor() {
|
|
108
120
|
this.Label = undefined;
|
|
@@ -3759,6 +3771,106 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
|
|
|
3759
3771
|
}]
|
|
3760
3772
|
}] });
|
|
3761
3773
|
|
|
3774
|
+
class TruWindowEventArgs {
|
|
3775
|
+
constructor() {
|
|
3776
|
+
this.title = '';
|
|
3777
|
+
this.tableName = '';
|
|
3778
|
+
this.tablePluralName = '';
|
|
3779
|
+
this.tablePluralLabel = '';
|
|
3780
|
+
this.context = {};
|
|
3781
|
+
this.contentBottom = '23px';
|
|
3782
|
+
this.statusbarDirective = 'tru-statusbar';
|
|
3783
|
+
this.height = '450px';
|
|
3784
|
+
this.width = '900px';
|
|
3785
|
+
this.views = [{}];
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
TruWindowEventArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3789
|
+
TruWindowEventArgs.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, providedIn: 'root' });
|
|
3790
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, decorators: [{
|
|
3791
|
+
type: Injectable,
|
|
3792
|
+
args: [{
|
|
3793
|
+
providedIn: 'root'
|
|
3794
|
+
}]
|
|
3795
|
+
}] });
|
|
3796
|
+
|
|
3797
|
+
class TruDesktopManager {
|
|
3798
|
+
constructor(truWindowEventHandler) {
|
|
3799
|
+
this.truWindowEventHandler = truWindowEventHandler;
|
|
3800
|
+
this.getWindowEvent = (tableName, tablePluralName, tablePluralLabel, componentName, data) => {
|
|
3801
|
+
var windowEvent = new TruWindowEventArgs();
|
|
3802
|
+
windowEvent.tableName = tableName;
|
|
3803
|
+
windowEvent.tablePluralName = tablePluralName;
|
|
3804
|
+
windowEvent.tablePluralLabel = tablePluralLabel;
|
|
3805
|
+
windowEvent.views = [
|
|
3806
|
+
{
|
|
3807
|
+
active: true,
|
|
3808
|
+
entities: undefined,
|
|
3809
|
+
entityIndex: 0,
|
|
3810
|
+
isDirty: false,
|
|
3811
|
+
isEditing: false,
|
|
3812
|
+
isInvalid: false,
|
|
3813
|
+
data: data,
|
|
3814
|
+
componentName: componentName
|
|
3815
|
+
}
|
|
3816
|
+
];
|
|
3817
|
+
return windowEvent;
|
|
3818
|
+
};
|
|
3819
|
+
/**
|
|
3820
|
+
* Opens a window for a directive.
|
|
3821
|
+
* @param {string} directiveName - name of the view directive.
|
|
3822
|
+
* @param {object} data - values to pass to the view.
|
|
3823
|
+
* @param {optional bool} showIfExists - if true and a view already exists for the
|
|
3824
|
+
* directive, then shows its window instead of creating a new one.
|
|
3825
|
+
*/
|
|
3826
|
+
this.addWindow = (tableName, tablePluralName, tablePluralLabel, componentName, data = null, showNavigation = true, showIfExists) => {
|
|
3827
|
+
this.truWindowEventHandler.open(this.getWindowEvent(tableName, tablePluralName, tablePluralLabel, componentName, data));
|
|
3828
|
+
};
|
|
3829
|
+
this.windowTitlesByBaseText = {};
|
|
3830
|
+
/**
|
|
3831
|
+
* Returns a unique string for the base name of a window. At first, returns the input.
|
|
3832
|
+
* For second call with same base name, returns the name plus ' - 2' and so on. When
|
|
3833
|
+
* all of the titles for the base name are released, then the next title will have no
|
|
3834
|
+
* suffix.
|
|
3835
|
+
* @param {string} text - base name of a window.
|
|
3836
|
+
* @returns {object} - text: the unique text and release(): releases the name for
|
|
3837
|
+
* future windows.
|
|
3838
|
+
*/
|
|
3839
|
+
this.getUniqueTitle = (text) => {
|
|
3840
|
+
var baseText = text;
|
|
3841
|
+
var titles = this.windowTitlesByBaseText[baseText];
|
|
3842
|
+
if (!titles) {
|
|
3843
|
+
this.windowTitlesByBaseText[baseText] = titles = {
|
|
3844
|
+
dispensedCount: 1,
|
|
3845
|
+
activeCount: 1
|
|
3846
|
+
};
|
|
3847
|
+
}
|
|
3848
|
+
else {
|
|
3849
|
+
++titles.activeCount;
|
|
3850
|
+
text += ' - ' + (++titles.dispensedCount);
|
|
3851
|
+
}
|
|
3852
|
+
return {
|
|
3853
|
+
text: text,
|
|
3854
|
+
release: () => {
|
|
3855
|
+
if (titles.activeCount === 1)
|
|
3856
|
+
delete this.windowTitlesByBaseText[baseText];
|
|
3857
|
+
else {
|
|
3858
|
+
--titles.activeCount;
|
|
3859
|
+
}
|
|
3860
|
+
}
|
|
3861
|
+
};
|
|
3862
|
+
};
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
TruDesktopManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, deps: [{ token: TruWindowEventHandler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3866
|
+
TruDesktopManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, providedIn: 'root' });
|
|
3867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruDesktopManager, decorators: [{
|
|
3868
|
+
type: Injectable,
|
|
3869
|
+
args: [{
|
|
3870
|
+
providedIn: 'root',
|
|
3871
|
+
}]
|
|
3872
|
+
}], ctorParameters: function () { return [{ type: TruWindowEventHandler }]; } });
|
|
3873
|
+
|
|
3762
3874
|
class TruWindowActionEventHandler {
|
|
3763
3875
|
constructor() {
|
|
3764
3876
|
this.save$ = new Subject();
|
|
@@ -3803,29 +3915,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
|
|
|
3803
3915
|
}]
|
|
3804
3916
|
}] });
|
|
3805
3917
|
|
|
3806
|
-
class TruWindowEventArgs {
|
|
3807
|
-
constructor() {
|
|
3808
|
-
this.title = '';
|
|
3809
|
-
this.tableName = '';
|
|
3810
|
-
this.tablePluralName = '';
|
|
3811
|
-
this.tablePluralLabel = '';
|
|
3812
|
-
this.context = {};
|
|
3813
|
-
this.contentBottom = '23px';
|
|
3814
|
-
this.statusbarDirective = 'tru-statusbar';
|
|
3815
|
-
this.height = '450px';
|
|
3816
|
-
this.width = '900px';
|
|
3817
|
-
this.views = [{}];
|
|
3818
|
-
}
|
|
3819
|
-
}
|
|
3820
|
-
TruWindowEventArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3821
|
-
TruWindowEventArgs.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, providedIn: 'root' });
|
|
3822
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruWindowEventArgs, decorators: [{
|
|
3823
|
-
type: Injectable,
|
|
3824
|
-
args: [{
|
|
3825
|
-
providedIn: 'root'
|
|
3826
|
-
}]
|
|
3827
|
-
}] });
|
|
3828
|
-
|
|
3829
3918
|
class TruExportDialogModule {
|
|
3830
3919
|
}
|
|
3831
3920
|
TruExportDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: TruExportDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -4520,5 +4609,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
|
|
|
4520
4609
|
* Generated bundle index. Do not edit.
|
|
4521
4610
|
*/
|
|
4522
4611
|
|
|
4523
|
-
export { TruAppEnvironment, TruBreezeContext, TruBreezeContextFactory, TruBreezeMetadataProvider, TruColumn, TruColumnModule, TruCommonModule, TruComponentLookup, TruConfirmDialog, TruConfirmDialogConfig, TruConfirmDialogModule, TruDataContext, TruDataGrid, TruDataGridModule, TruDataGridTypes, TruDesktop, TruDesktopModule, TruEntityAccessor, TruEntityBase, TruExportDialog, TruExportDialogConfig, TruExportDialogModule, TruForm, TruFormModule, TruFormulaEval, TruGroupBox, TruGroupBoxModule, TruPredicate, TruPredicateMap, TruPropertyConfigBase, TruPropertyConfigCloudFile, TruPropertyConfigDecimal, TruPropertyConfigForeignKey, TruPropertyConfigInteger, TruPropertyConfigPassword, TruPropertyConfigPercentage, TruPropertyConfigScientific, TruPropertyConfigText, TruPropertyConfigTextChoices, TruPropertyConfigUsaAddress, TruPropertyConfigZipCode, TruQueryPredicateManager, TruRow, TruRowModule, TruSearchComponentBase, TruSearchComponentConfigBase, TruSearchGroupEventHandler, TruSearchIconModule, TruSearchPanelPositionManager, TruSearchPanelPositionManagerModule, TruSearchViewEventHandler, TruSort, TruTableConfigBase, TruTextManager, TruToolbar, TruToolbarButton, TruToolbarButtonModule, TruToolbarContextFilter, TruToolbarContextFilterModule, TruToolbarDropdown, TruToolbarDropdownModule, TruToolbarMenu, TruToolbarMenuModule, TruToolbarModule, TruToolbarSeparator, TruToolbarSeparatorModule, TruToolbarText, TruToolbarTextModule, TruUiNotification, TruUser, TruWindowActionEventHandler, TruWindowAddViewEventArgs, TruWindowEventArgs, TruWindowEventHandler };
|
|
4612
|
+
export { TruAppEnvironment, TruBreezeContext, TruBreezeContextFactory, TruBreezeMetadataProvider, TruColumn, TruColumnModule, TruCommonModule, TruComponentConfigBase, TruComponentLookup, TruConfirmDialog, TruConfirmDialogConfig, TruConfirmDialogModule, TruControlComponentConfigBase, TruDataContext, TruDataGrid, TruDataGridModule, TruDataGridTypes, TruDesktop, TruDesktopManager, TruDesktopModule, TruEntityAccessor, TruEntityBase, TruExportDialog, TruExportDialogConfig, TruExportDialogModule, TruForm, TruFormModule, TruFormulaEval, TruGroupBox, TruGroupBoxModule, TruPredicate, TruPredicateMap, TruPropertyConfigBase, TruPropertyConfigCloudFile, TruPropertyConfigDecimal, TruPropertyConfigForeignKey, TruPropertyConfigInteger, TruPropertyConfigPassword, TruPropertyConfigPercentage, TruPropertyConfigScientific, TruPropertyConfigText, TruPropertyConfigTextChoices, TruPropertyConfigUsaAddress, TruPropertyConfigZipCode, TruQueryPredicateManager, TruRow, TruRowModule, TruSearchComponentBase, TruSearchComponentConfigBase, TruSearchConfigBase, TruSearchGroupEventHandler, TruSearchIconModule, TruSearchPanelPositionManager, TruSearchPanelPositionManagerModule, TruSearchViewEventHandler, TruSort, TruTableConfigBase, TruTextManager, TruToolbar, TruToolbarButton, TruToolbarButtonModule, TruToolbarContextFilter, TruToolbarContextFilterModule, TruToolbarDropdown, TruToolbarDropdownModule, TruToolbarMenu, TruToolbarMenuModule, TruToolbarModule, TruToolbarSeparator, TruToolbarSeparatorModule, TruToolbarText, TruToolbarTextModule, TruUiNotification, TruUser, TruWindowActionEventHandler, TruWindowAddViewEventArgs, TruWindowEventArgs, TruWindowEventHandler };
|
|
4524
4613
|
//# sourceMappingURL=trudb-tru-common-lib.mjs.map
|