turbogui-angular 17.0.1 → 18.0.0
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/fesm2022/turbogui-angular.mjs +264 -86
- package/fesm2022/turbogui-angular.mjs.map +1 -1
- package/main/controller/dialog.service.d.ts +10 -8
- package/main/controller/dialog.service.d.ts.map +1 -1
- package/main/controller/locales.service.d.ts +16 -3
- package/main/controller/locales.service.d.ts.map +1 -1
- package/main/controller/router-base.service.d.ts +93 -0
- package/main/controller/router-base.service.d.ts.map +1 -0
- package/main/model/classes/View.d.ts +19 -8
- package/main/model/classes/View.d.ts.map +1 -1
- package/main/view/components/button-container/button-container.component.d.ts +1 -0
- package/main/view/components/button-container/button-container.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/public_api.d.ts.map +1 -1
|
@@ -133,9 +133,9 @@ export declare class DialogService extends SingletoneStrictClass {
|
|
|
133
133
|
* @param action If not empty, the text to place on the snackbar confirmation button
|
|
134
134
|
* @param actionCallback A method to execute once the user clicks into the action button.
|
|
135
135
|
*
|
|
136
|
-
* @return
|
|
136
|
+
* @return A promise that will be resolved once the snackbar is closed.
|
|
137
137
|
*/
|
|
138
|
-
addSnackBar(config: MatSnackBarConfig, message: string, action?: string
|
|
138
|
+
addSnackBar(config: MatSnackBarConfig, message: string, action?: string): Promise<unknown>;
|
|
139
139
|
/**
|
|
140
140
|
* Tells if the application is currently showing a snackbar or not
|
|
141
141
|
*/
|
|
@@ -169,8 +169,9 @@ export declare class DialogService extends SingletoneStrictClass {
|
|
|
169
169
|
* - viewContainerRef: This is important if we want to propagate providers from a parent component to this dialog. We must specify
|
|
170
170
|
* this reference to make sure the same services injected on the parent are available too at the child dialog
|
|
171
171
|
*
|
|
172
|
-
* @
|
|
173
|
-
*
|
|
172
|
+
* @return A promise that will be resolved once the dialog is closed.
|
|
173
|
+
* The promise will receive a selection object with two properties which will correspond to the index and value from the options
|
|
174
|
+
* array that's selected by the user. If no option selected, index will be -1 and value null
|
|
174
175
|
*/
|
|
175
176
|
addDialog(dialogComponentClass: Type<DialogBaseComponent>, properties: {
|
|
176
177
|
id?: string;
|
|
@@ -183,10 +184,10 @@ export declare class DialogService extends SingletoneStrictClass {
|
|
|
183
184
|
options?: string[];
|
|
184
185
|
data?: any;
|
|
185
186
|
viewContainerRef?: ViewContainerRef;
|
|
186
|
-
}
|
|
187
|
+
}): Promise<{
|
|
187
188
|
index: number;
|
|
188
189
|
value?: any;
|
|
189
|
-
}
|
|
190
|
+
}>;
|
|
190
191
|
/**
|
|
191
192
|
* Show a dialog with a calendar to let the user pick a date.
|
|
192
193
|
*
|
|
@@ -204,7 +205,8 @@ export declare class DialogService extends SingletoneStrictClass {
|
|
|
204
205
|
* - title: An optional dialog title
|
|
205
206
|
* - viewContainerRef: This is important to propagate providers from a parent component to this dialog. We must specify
|
|
206
207
|
* this reference to make sure the same services injected on the parent are available too at the child dialog
|
|
207
|
-
*
|
|
208
|
+
*
|
|
209
|
+
* @returns A Promise that resolves to a Date() object selected by the user or null if no selection was made
|
|
208
210
|
*/
|
|
209
211
|
addDateSelectionDialog(properties: {
|
|
210
212
|
id?: string;
|
|
@@ -215,7 +217,7 @@ export declare class DialogService extends SingletoneStrictClass {
|
|
|
215
217
|
modal?: boolean;
|
|
216
218
|
title?: string;
|
|
217
219
|
viewContainerRef: ViewContainerRef;
|
|
218
|
-
}
|
|
220
|
+
}): Promise<Date | null>;
|
|
219
221
|
/**
|
|
220
222
|
* Force the removal of all the dialogs that are currently visible.
|
|
221
223
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.service.d.ts","sourceRoot":"","sources":["../../../../projects/turbogui-angular/src/main/controller/dialog.service.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,IAAI,EAAc,wBAAwB,EAAE,QAAQ,EAAE,cAAc,EAAa,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACpJ,OAA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63
|
*/
|
|
64
64
|
setWildCardsFormat(value: string): string;
|
|
65
65
|
/**
|
|
66
|
-
* Defines the behaviour for
|
|
66
|
+
* Defines the behaviour for t(), tStartCase(), etc... methods when a key is not found on
|
|
67
67
|
* a bundle or the bundle does not exist
|
|
68
68
|
*
|
|
69
69
|
* If missingKeyFormat is an empty string, all missing keys will return an empty value (not recommended)
|
|
@@ -83,6 +83,19 @@ export declare class LocalesService extends SingletoneStrictClass {
|
|
|
83
83
|
* @see setMissingKeyFormat()
|
|
84
84
|
*/
|
|
85
85
|
getMissingKeyFormat(): string;
|
|
86
|
+
/**
|
|
87
|
+
* Initializes the translation system by loading and parsing bundle files from the specified JSON object.
|
|
88
|
+
* After the method finishes, the class will contain all the translation data and will be ready to translate any provided key.
|
|
89
|
+
*
|
|
90
|
+
* @param translations A JSON object containing the translation data. The structure must be as follows:
|
|
91
|
+
* { library_name: { bundle_name: { locale_code: { key1: "translation1", key2: "translation2" } } } ... }
|
|
92
|
+
*
|
|
93
|
+
* @param locales An array of locale codes (e.g., ['en_US', 'es_ES', 'fr_FR']) to load into this class. The order of this array
|
|
94
|
+
* will determine the translation priority
|
|
95
|
+
*
|
|
96
|
+
* @return True if the translations get correctly loaded. Any unsuccessful initialization will throw an exception
|
|
97
|
+
*/
|
|
98
|
+
initializeFromJson(translations: any, locales: string[]): boolean;
|
|
86
99
|
/**
|
|
87
100
|
* Initializes the translation system by loading and parsing bundle files from the specified translations path.
|
|
88
101
|
* After the promise finishes, the class will contain all the translation data and will be ready to translate any
|
|
@@ -96,7 +109,7 @@ export declare class LocalesService extends SingletoneStrictClass {
|
|
|
96
109
|
*
|
|
97
110
|
* @return A promise that will resolve if the translations get correctly loaded, or reject with an error if load fails
|
|
98
111
|
*/
|
|
99
|
-
|
|
112
|
+
initializeFromUrl(translationsPath: string, locales: string[], parameters: string[]): Promise<unknown>;
|
|
100
113
|
/**
|
|
101
114
|
* Check if the class has been correctly initialized and translations have been correctly loaded
|
|
102
115
|
*/
|
|
@@ -189,7 +202,7 @@ export declare class LocalesService extends SingletoneStrictClass {
|
|
|
189
202
|
* list for a translated text. If missing, the next one will be used, and so. This list is constructed after initialize
|
|
190
203
|
* methods is called.
|
|
191
204
|
*
|
|
192
|
-
* @example: After loading the following list of locales ['en_US', 'es_ES', 'fr_FR'] if we call
|
|
205
|
+
* @example: After loading the following list of locales ['en_US', 'es_ES', 'fr_FR'] if we call t('HELLO', 'lib1/greetings')
|
|
193
206
|
* the localization manager will try to locate the en_US value for the HELLO tag on the greetings bundle for the library lib1.
|
|
194
207
|
* If the tag is not found for the specified locale and bundle, the same search will be performed for the es_ES locale, and so, till a
|
|
195
208
|
* value is found or no more locales are defined.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.service.d.ts","sourceRoot":"","sources":["../../../../projects/turbogui-angular/src/main/controller/locales.service.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;;AAG/E;;GAEG;AACH,qBAGa,cAAe,SAAQ,qBAAqB;IAGrD;;OAEG;IACH,OAAO,CAAC,cAAc,CAAS;IAG/B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAe;IAG/B;;OAEG;IACH,OAAO,CAAC,UAAU,CAAe;IAGjC;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAAU;IAGrC;;OAEG;IACH,OAAO,CAAC,eAAe,CAAU;IAGjC;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAS;IAGjC;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAAgB;IAGzC;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB,CAAM;IAGlC;;OAEG;;IAOH;;;;;;;;;;;;;;;;;OAiBG;IACH,kBAAkB,CAAC,KAAK,EAAC,MAAM;IAe/B;;;;;;;;;;;;;;;OAeG;IACH,mBAAmB,CAAC,KAAK,EAAC,MAAM;IAUhC;;OAEG;IACH,mBAAmB;IAMnB;;;;;;;;;;;;OAYG;IACH,
|
|
1
|
+
{"version":3,"file":"locales.service.d.ts","sourceRoot":"","sources":["../../../../projects/turbogui-angular/src/main/controller/locales.service.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;;AAG/E;;GAEG;AACH,qBAGa,cAAe,SAAQ,qBAAqB;IAGrD;;OAEG;IACH,OAAO,CAAC,cAAc,CAAS;IAG/B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAe;IAG/B;;OAEG;IACH,OAAO,CAAC,UAAU,CAAe;IAGjC;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAAU;IAGrC;;OAEG;IACH,OAAO,CAAC,eAAe,CAAU;IAGjC;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAS;IAGjC;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAAgB;IAGzC;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB,CAAM;IAGlC;;OAEG;;IAOH;;;;;;;;;;;;;;;;;OAiBG;IACH,kBAAkB,CAAC,KAAK,EAAC,MAAM;IAe/B;;;;;;;;;;;;;;;OAeG;IACH,mBAAmB,CAAC,KAAK,EAAC,MAAM;IAUhC;;OAEG;IACH,mBAAmB;IAMnB;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,YAAY,EAAC,GAAG,EAAE,OAAO,EAAC,MAAM,EAAE;IAwCrD;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,gBAAgB,EAAC,MAAM,EAAE,OAAO,EAAC,MAAM,EAAE,EAAE,UAAU,EAAC,MAAM,EAAE;IA+BhF;;OAEG;IACH,aAAa;IAMb;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;;;;;OAMG;IACH,cAAc,CAAC,MAAM,EAAC,MAAM;IAQ5B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAS7B;;;;;;OAMG;IACH,gBAAgB,CAAC,QAAQ,EAAC,MAAM;IAQhC;;;;OAIG;IACH,uBAAuB,CAAC,QAAQ,EAAC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
|
|
2
|
+
* TurboGUI is A library that helps with the most common and generic UI elements and functionalities
|
|
3
|
+
*
|
|
4
|
+
* Website : -> http://www.turbogui.org
|
|
5
|
+
* License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
|
|
6
|
+
* License Url : -> http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
* CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
|
|
8
|
+
*/
|
|
9
|
+
import { OnDestroy } from '@angular/core';
|
|
10
|
+
import { Title } from '@angular/platform-browser';
|
|
11
|
+
import { Router } from '@angular/router';
|
|
12
|
+
import { LocalesService } from './locales.service';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
/**
|
|
15
|
+
* Global service that helps with application routing and related functionalities.
|
|
16
|
+
* It is defined as an abstract class so it must be extended in our application to be used.
|
|
17
|
+
* We must declare a static array of routes that will be used to define the routes of the application.
|
|
18
|
+
*/
|
|
19
|
+
export declare abstract class RouterBaseService implements OnDestroy {
|
|
20
|
+
private readonly router;
|
|
21
|
+
private readonly titleService;
|
|
22
|
+
private readonly ls;
|
|
23
|
+
/**
|
|
24
|
+
* Indicates whether the title manager has been initialized.
|
|
25
|
+
* This should only be done once, typically at application startup.
|
|
26
|
+
*/
|
|
27
|
+
private _isTitleManagerInitialized;
|
|
28
|
+
/**
|
|
29
|
+
* Subscription to router events. This is used to update the current route URL
|
|
30
|
+
*/
|
|
31
|
+
private _routerSubscription;
|
|
32
|
+
/**
|
|
33
|
+
* BehaviorSubject that holds the current route URL.
|
|
34
|
+
* This allows components to reactively subscribe to route changes.
|
|
35
|
+
*/
|
|
36
|
+
private readonly _currentRoute;
|
|
37
|
+
constructor(router: Router, titleService: Title, ls: LocalesService);
|
|
38
|
+
/**
|
|
39
|
+
* Updates the current route URL in the BehaviorSubject.
|
|
40
|
+
* This is called internally after each navigation event.
|
|
41
|
+
*/
|
|
42
|
+
private _updateCurrentRoute;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if the current route matches the specified route.
|
|
45
|
+
*
|
|
46
|
+
* @param route The route to check against the current route.
|
|
47
|
+
*
|
|
48
|
+
* @returns True if we are actually at the specified route, false otherwise.
|
|
49
|
+
*/
|
|
50
|
+
isRouteCurrent(route: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Gets the current value of the route URL synchronously.
|
|
53
|
+
*/
|
|
54
|
+
getCurrentRoute(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Initializes the title management feature to automatically refresh the browser title based on the current
|
|
57
|
+
* URL route. It Must be called once, typically at application startup
|
|
58
|
+
*
|
|
59
|
+
* To correctly translate the route title, We expect the route definitions to have the following properties:
|
|
60
|
+
*
|
|
61
|
+
* - titleKey: The key to be used to get the title from the translation bundle.
|
|
62
|
+
* - titleBundle: The bundle to be used to get the title from the translation bundle.
|
|
63
|
+
*
|
|
64
|
+
* (Translations will be done using the LocalesService from this same library).
|
|
65
|
+
*
|
|
66
|
+
* Example of a Route using this feature:
|
|
67
|
+
* // Home route
|
|
68
|
+
* { path: '', component: HomePageComponent,
|
|
69
|
+
* data: { titleKey: 'HOME', titleBundle: 'turbodepot/user-interface'} },
|
|
70
|
+
*
|
|
71
|
+
* @param prefix A text to be added before the computed title.
|
|
72
|
+
* @param sufix A text to be added after the computed title.
|
|
73
|
+
*/
|
|
74
|
+
initializeAutoTranslateTitleByRoute(prefix?: string, sufix?: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* Aux method: Updates the browser title based on the current route's data properties.
|
|
77
|
+
* This is called after each navigation event to ensure the title is always up-to-date.
|
|
78
|
+
*
|
|
79
|
+
* @param prefix A text to be added before the computed title.
|
|
80
|
+
* @param sufix A text to be added after the computed title.
|
|
81
|
+
*/
|
|
82
|
+
private updateTitleFromCurrentRoute;
|
|
83
|
+
/**
|
|
84
|
+
* Navigates to the specified route.
|
|
85
|
+
*
|
|
86
|
+
* @param route The route to navigate to.
|
|
87
|
+
*/
|
|
88
|
+
navigateTo(route: string): void;
|
|
89
|
+
ngOnDestroy(): void;
|
|
90
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterBaseService, never>;
|
|
91
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RouterBaseService>;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=router-base.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-base.service.d.ts","sourceRoot":"","sources":["../../../../projects/turbogui-angular/src/main/controller/router-base.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAc,SAAS,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;;AAGnD;;;;GAIG;AACH,8BAGsB,iBAAkB,YAAW,SAAS;IAuB5C,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,EAAE;IAtB/B;;;OAGG;IACH,OAAO,CAAC,0BAA0B,CAAS;IAG3C;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAA2B;IAGtD;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgD;gBAGjD,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,KAAK,EACnB,EAAE,EAAE,cAAc;IAO/C;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAM3B;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,EAAC,MAAM;IAM3B;;OAEG;IACH,eAAe,IAAI,MAAM;IAMzB;;;;;;;;;;;;;;;;;;OAkBG;IACH,mCAAmC,CAAC,MAAM,GAAC,MAAW,EAAE,KAAK,GAAC,MAAW,GAAG,IAAI;IAyBhF;;;;;;OAMG;IACH,OAAO,CAAC,2BAA2B;IAkBnC;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAC,MAAM;IAMvB,WAAW,IAAI,IAAI;yCAhJD,iBAAiB;6CAAjB,iBAAiB;CAuJtC"}
|
|
@@ -9,20 +9,31 @@
|
|
|
9
9
|
import { ViewContainerRef } from "@angular/core";
|
|
10
10
|
import { ViewService } from "./ViewService";
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* This is a base class that helps managing our application pages.
|
|
13
|
+
* We should extend this class to create our application pages, as it forces us to set the viewContainerRef and the viewService,
|
|
14
|
+
* which are both used when working with pages.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
* be created and destroyed when the view is created and destroyed.
|
|
16
|
+
* IMPORTANT!!! View services are created and destroyed when the page is created and destroyed. It is vital to specify the view service
|
|
17
|
+
* as a provider for the page to ensure that it will be created and destroyed when the view is created and destroyed.
|
|
18
|
+
*
|
|
19
|
+
* Example:
|
|
20
|
+
*
|
|
21
|
+
* @Component({
|
|
22
|
+
* ...
|
|
23
|
+
* selector: 'app-my-view-page',
|
|
24
|
+
* providers: [MyViewService]
|
|
25
|
+
* ...
|
|
26
|
+
*})
|
|
18
27
|
*/
|
|
19
28
|
export declare abstract class View {
|
|
20
29
|
viewContainerRef: ViewContainerRef;
|
|
21
30
|
viewService: ViewService | null;
|
|
22
31
|
/**
|
|
23
|
-
* This constructor is specifically designed to force the
|
|
24
|
-
*
|
|
25
|
-
*
|
|
32
|
+
* This constructor is specifically designed to force the following:
|
|
33
|
+
*
|
|
34
|
+
* - Set the viewContainerRef which will be automatically assigned to the respective view service.
|
|
35
|
+
*
|
|
36
|
+
* - If the view has no service, we can set it to null, but it is recommended to always use a service with a view, to store the view state and global methods
|
|
26
37
|
*/
|
|
27
38
|
constructor(viewContainerRef: ViewContainerRef, viewService: ViewService | null);
|
|
28
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../../../projects/turbogui-angular/src/main/model/classes/View.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C
|
|
1
|
+
{"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../../../projects/turbogui-angular/src/main/model/classes/View.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C;;;;;;;;;;;;;;;;GAgBG;AACH,8BAAsB,IAAI;IAUN,gBAAgB,EAAE,gBAAgB;IAAS,WAAW,EAAC,WAAW,GAAC,IAAI;IAP1F;;;;;;OAMG;gBACgB,gBAAgB,EAAE,gBAAgB,EAAS,WAAW,EAAC,WAAW,GAAC,IAAI;CAO1F"}
|
|
@@ -3,6 +3,7 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
export declare class ButtonContainerComponent extends ButtonBaseComponent {
|
|
4
4
|
/**
|
|
5
5
|
* This is used to attach the fade animation directly to this component so it fades in and out when created and removed from the app
|
|
6
|
+
* TODO: THIS IS NOT A GOOD IDEA
|
|
6
7
|
*/
|
|
7
8
|
buttonFade: boolean;
|
|
8
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonContainerComponent, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-container.component.d.ts","sourceRoot":"","sources":["../../../../../../projects/turbogui-angular/src/main/view/components/button-container/button-container.component.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4DAA4D,CAAC;;AAGjG,qBAaa,wBAAyB,SAAQ,mBAAmB;IAG7D
|
|
1
|
+
{"version":3,"file":"button-container.component.d.ts","sourceRoot":"","sources":["../../../../../../projects/turbogui-angular/src/main/view/components/button-container/button-container.component.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4DAA4D,CAAC;;AAGjG,qBAaa,wBAAyB,SAAQ,mBAAmB;IAG7D;;;OAGG;IACyB,UAAU,UAAQ;yCAPrC,wBAAwB;2CAAxB,wBAAwB;CAQpC"}
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { HTTPServicePostRequest } from './main/controller/httpservice/HTTPServic
|
|
|
11
11
|
export { TurboApiCallerService } from './main/controller/turbo-api-caller.service';
|
|
12
12
|
export { DialogService } from './main/controller/dialog.service';
|
|
13
13
|
export { BrowserService } from './main/controller/browser.service';
|
|
14
|
+
export { RouterBaseService } from './main/controller/router-base.service';
|
|
14
15
|
/**
|
|
15
16
|
* Components
|
|
16
17
|
*/
|
package/public_api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../projects/turbogui-angular/src/public_api.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAGrF;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../projects/turbog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