@stemy/ngx-utils 11.0.8 → 11.1.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/README.md +27 -27
- package/bundles/stemy-ngx-utils.umd.js +22 -7
- package/bundles/stemy-ngx-utils.umd.js.map +1 -1
- package/bundles/stemy-ngx-utils.umd.min.js +1 -1
- package/bundles/stemy-ngx-utils.umd.min.js.map +1 -1
- package/esm2015/ngx-utils/common-types.js +2 -1
- package/esm2015/ngx-utils/ngx-utils.module.js +6 -2
- package/esm2015/ngx-utils/services/config.service.js +8 -4
- package/esm2015/ngx-utils/services/promise.service.js +4 -1
- package/esm2015/ngx-utils/services/static-language.service.js +9 -7
- package/esm2015/ngx-utils/utils/unique.utils.js +1 -1
- package/esm2015/public_api.js +2 -2
- package/fesm2015/stemy-ngx-utils.js +22 -8
- package/fesm2015/stemy-ngx-utils.js.map +1 -1
- package/ngx-utils/common-types.d.ts +2 -0
- package/ngx-utils/services/config.service.d.ts +3 -1
- package/ngx-utils/services/promise.service.d.ts +5 -4
- package/ngx-utils/services/static-language.service.d.ts +3 -2
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
- package/stemy-ngx-utils.metadata.json +1 -1
- package/esm5/ngx-utils/common-types.js +0 -553
- package/esm5/ngx-utils/components/dynamic-table/dynamic-table.component.js +0 -285
- package/esm5/ngx-utils/components/pagination-menu/pagination-menu.component.js +0 -198
- package/esm5/ngx-utils/components/unordered-list/unordered-list.component.js +0 -110
- package/esm5/ngx-utils/directives/async-method.directive.js +0 -105
- package/esm5/ngx-utils/directives/background.directive.js +0 -91
- package/esm5/ngx-utils/directives/dynamic-table-template.directive.js +0 -34
- package/esm5/ngx-utils/directives/icon.directive.js +0 -101
- package/esm5/ngx-utils/directives/ngx-template-outlet.directive.js +0 -182
- package/esm5/ngx-utils/directives/pagination-item.directive.js +0 -70
- package/esm5/ngx-utils/directives/pagination.directive.js +0 -148
- package/esm5/ngx-utils/directives/resource-if.directive.js +0 -97
- package/esm5/ngx-utils/directives/sticky.directive.js +0 -93
- package/esm5/ngx-utils/directives/unordered-list-item.directive.js +0 -143
- package/esm5/ngx-utils/directives/unordered-list-template.directive.js +0 -54
- package/esm5/ngx-utils/ngx-utils.module.js +0 -205
- package/esm5/ngx-utils/pipes/chunk.pipe.js +0 -41
- package/esm5/ngx-utils/pipes/entries.pipe.js +0 -54
- package/esm5/ngx-utils/pipes/extra-item-properties.pipe.js +0 -51
- package/esm5/ngx-utils/pipes/filter.pipe.js +0 -65
- package/esm5/ngx-utils/pipes/find.pipe.js +0 -51
- package/esm5/ngx-utils/pipes/format-number.pipe.js +0 -44
- package/esm5/ngx-utils/pipes/get-offset.pipe.js +0 -31
- package/esm5/ngx-utils/pipes/get-type.pipe.js +0 -28
- package/esm5/ngx-utils/pipes/group-by.pipe.js +0 -48
- package/esm5/ngx-utils/pipes/is-type.pipe.js +0 -30
- package/esm5/ngx-utils/pipes/join.pipe.js +0 -34
- package/esm5/ngx-utils/pipes/keys.pipe.js +0 -35
- package/esm5/ngx-utils/pipes/map.pipe.js +0 -52
- package/esm5/ngx-utils/pipes/max.pipe.js +0 -45
- package/esm5/ngx-utils/pipes/min.pipe.js +0 -45
- package/esm5/ngx-utils/pipes/reduce.pipe.js +0 -55
- package/esm5/ngx-utils/pipes/remap.pipe.js +0 -51
- package/esm5/ngx-utils/pipes/replace.pipe.js +0 -32
- package/esm5/ngx-utils/pipes/reverse.pipe.js +0 -38
- package/esm5/ngx-utils/pipes/round.pipe.js +0 -44
- package/esm5/ngx-utils/pipes/safe-html.pipe.js +0 -54
- package/esm5/ngx-utils/pipes/translate.pipe.js +0 -111
- package/esm5/ngx-utils/pipes/values.pipe.js +0 -35
- package/esm5/ngx-utils/plugins/resize-event.plugin.js +0 -122
- package/esm5/ngx-utils/plugins/scroll-event.plugin.js +0 -110
- package/esm5/ngx-utils/services/acl.service.js +0 -119
- package/esm5/ngx-utils/services/auth.service.js +0 -40
- package/esm5/ngx-utils/services/events.service.js +0 -33
- package/esm5/ngx-utils/services/formatter.service.js +0 -124
- package/esm5/ngx-utils/services/icon.service.js +0 -32
- package/esm5/ngx-utils/services/language.service.js +0 -199
- package/esm5/ngx-utils/services/promise.service.js +0 -123
- package/esm5/ngx-utils/services/state.service.js +0 -271
- package/esm5/ngx-utils/services/storage.service.js +0 -100
- package/esm5/ngx-utils/services/toaster.service.js +0 -100
- package/esm5/ngx-utils/services/universal.service.js +0 -153
- package/esm5/ngx-utils/utils/ajax-request-handler.js +0 -73
- package/esm5/ngx-utils/utils/array.utils.js +0 -182
- package/esm5/ngx-utils/utils/auth.guard.js +0 -205
- package/esm5/ngx-utils/utils/canvas.utils.js +0 -668
- package/esm5/ngx-utils/utils/date.utils.js +0 -91
- package/esm5/ngx-utils/utils/file.utils.js +0 -201
- package/esm5/ngx-utils/utils/loader.utils.js +0 -90
- package/esm5/ngx-utils/utils/math.utils.js +0 -62
- package/esm5/ngx-utils/utils/object.utils.js +0 -513
- package/esm5/ngx-utils/utils/observable.utils.js +0 -30
- package/esm5/ngx-utils/utils/reflect.utils.js +0 -95
- package/esm5/ngx-utils/utils/set.utils.js +0 -48
- package/esm5/ngx-utils/utils/string.utils.js +0 -94
- package/esm5/ngx-utils/utils/timer.utils.js +0 -100
- package/esm5/ngx-utils/utils/unique.utils.js +0 -54
- package/esm5/ngx-utils/utils/vector.js +0 -223
- package/esm5/public_api.js +0 -73
- package/esm5/stemy-ngx-utils.js +0 -11
- package/fesm5/stemy-ngx-utils.js +0 -6709
- package/fesm5/stemy-ngx-utils.js.map +0 -1
- package/typings.d.ts +0 -5
|
@@ -412,6 +412,7 @@ class IConfiguration {
|
|
|
412
412
|
const CONFIG_SERVICE = new InjectionToken("config-service");
|
|
413
413
|
const BASE_CONFIG = new InjectionToken("base-config");
|
|
414
414
|
const SCRIPT_PARAMS = new InjectionToken("script-params");
|
|
415
|
+
const ROOT_ELEMENT = new InjectionToken("app-root-element");
|
|
415
416
|
const ERROR_HANDLER = new InjectionToken("error-handler-callback");
|
|
416
417
|
// --- Valued promise ---
|
|
417
418
|
class ValuedPromise extends Promise {
|
|
@@ -2390,9 +2391,10 @@ class StaticAuthService {
|
|
|
2390
2391
|
}
|
|
2391
2392
|
|
|
2392
2393
|
class ConfigService {
|
|
2393
|
-
constructor(http, universal, baseConfig = null, scriptParams = null) {
|
|
2394
|
+
constructor(http, universal, rootElement, baseConfig = null, scriptParams = null) {
|
|
2394
2395
|
this.http = http;
|
|
2395
2396
|
this.universal = universal;
|
|
2397
|
+
this.rootElement = rootElement;
|
|
2396
2398
|
for (const key in []) {
|
|
2397
2399
|
Object.defineProperty(Array.prototype, key, {
|
|
2398
2400
|
enumerable: false
|
|
@@ -2407,13 +2409,15 @@ class ConfigService {
|
|
|
2407
2409
|
baseUrl = scriptSrc.substr(0, srcParts[0].lastIndexOf("/") + 1);
|
|
2408
2410
|
}
|
|
2409
2411
|
}
|
|
2410
|
-
this.
|
|
2412
|
+
this.baseConfig = baseConfig || {};
|
|
2413
|
+
this.loadedConfig = Object.assign(!baseUrl ? {} : { baseUrl }, this.baseConfig);
|
|
2411
2414
|
this.scriptParameters = scriptParams || {};
|
|
2412
2415
|
this.loaderFunc = () => {
|
|
2413
2416
|
this.loader = this.loader || new Promise((resolve, reject) => {
|
|
2414
2417
|
this.loadJson().then(config => {
|
|
2415
2418
|
this.loadedConfig = config = Object.assign(this.loadedConfig, config);
|
|
2416
2419
|
this.prepareConfig(config).then(c => {
|
|
2420
|
+
this.loadedConfig = c;
|
|
2417
2421
|
c.baseUrl = c.baseUrl || "/";
|
|
2418
2422
|
resolve(c);
|
|
2419
2423
|
});
|
|
@@ -2477,6 +2481,7 @@ ConfigService.decorators = [
|
|
|
2477
2481
|
ConfigService.ctorParameters = () => [
|
|
2478
2482
|
{ type: HttpClient },
|
|
2479
2483
|
{ type: UniversalService },
|
|
2484
|
+
{ type: undefined, decorators: [{ type: Inject, args: [ROOT_ELEMENT,] }] },
|
|
2480
2485
|
{ type: IConfiguration, decorators: [{ type: Optional }, { type: Inject, args: [BASE_CONFIG,] }] },
|
|
2481
2486
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [SCRIPT_PARAMS,] }] }
|
|
2482
2487
|
];
|
|
@@ -2647,10 +2652,11 @@ IconService.decorators = [
|
|
|
2647
2652
|
IconService.ctorParameters = () => [];
|
|
2648
2653
|
|
|
2649
2654
|
class StaticLanguageService {
|
|
2650
|
-
constructor(events, storage, configs, client) {
|
|
2655
|
+
constructor(events, storage, configs, promises, client) {
|
|
2651
2656
|
this.events = events;
|
|
2652
2657
|
this.storage = storage;
|
|
2653
2658
|
this.configs = configs;
|
|
2659
|
+
this.promises = promises;
|
|
2654
2660
|
this.client = client;
|
|
2655
2661
|
this.editLang = null;
|
|
2656
2662
|
this.currentLang = null;
|
|
@@ -2741,11 +2747,11 @@ class StaticLanguageService {
|
|
|
2741
2747
|
throw new Error(`Parameter "key" required`);
|
|
2742
2748
|
}
|
|
2743
2749
|
const translation = ObjectUtils.getValue(this.dictionary, key, key) || key;
|
|
2744
|
-
return
|
|
2750
|
+
return this.promises.resolve(this.interpolate(translation, params));
|
|
2745
2751
|
}
|
|
2746
2752
|
getTranslations(...keys) {
|
|
2747
|
-
return
|
|
2748
|
-
|
|
2753
|
+
return this.promises.create(resolve => {
|
|
2754
|
+
this.promises.all(keys.map(key => this.getTranslation(key))).then(translations => {
|
|
2749
2755
|
resolve(keys.reduce((result, key, i) => {
|
|
2750
2756
|
result[key] = translations[i];
|
|
2751
2757
|
return result;
|
|
@@ -2787,7 +2793,8 @@ StaticLanguageService.ctorParameters = () => [
|
|
|
2787
2793
|
{ type: EventsService, decorators: [{ type: Inject, args: [EventsService,] }] },
|
|
2788
2794
|
{ type: StorageService, decorators: [{ type: Inject, args: [StorageService,] }] },
|
|
2789
2795
|
{ type: undefined, decorators: [{ type: Inject, args: [CONFIG_SERVICE,] }] },
|
|
2790
|
-
{ type:
|
|
2796
|
+
{ type: undefined, decorators: [{ type: Inject, args: [PROMISE_SERVICE,] }] },
|
|
2797
|
+
{ type: BaseHttpClient, decorators: [{ type: Inject, args: [BaseHttpClient,] }] }
|
|
2791
2798
|
];
|
|
2792
2799
|
|
|
2793
2800
|
class LanguageService extends StaticLanguageService {
|
|
@@ -3055,6 +3062,9 @@ class PromiseService {
|
|
|
3055
3062
|
resolve(value) {
|
|
3056
3063
|
return this.add(this.zone.runOutsideAngular(() => Promise.resolve(value)));
|
|
3057
3064
|
}
|
|
3065
|
+
reject(value) {
|
|
3066
|
+
return this.add(this.zone.runOutsideAngular(() => Promise.reject(value)));
|
|
3067
|
+
}
|
|
3058
3068
|
promiseFinished() {
|
|
3059
3069
|
if (this.promiseCount == 0)
|
|
3060
3070
|
return;
|
|
@@ -4733,6 +4743,10 @@ class NgxUtilsModule {
|
|
|
4733
4743
|
provide: CONFIG_SERVICE,
|
|
4734
4744
|
useExisting: (!config ? null : config.configService) || ConfigService
|
|
4735
4745
|
},
|
|
4746
|
+
{
|
|
4747
|
+
provide: ROOT_ELEMENT,
|
|
4748
|
+
useValue: null
|
|
4749
|
+
},
|
|
4736
4750
|
{
|
|
4737
4751
|
provide: APP_INITIALIZER,
|
|
4738
4752
|
useFactory: (!config ? null : config.initializeApp) || loadConfig,
|
|
@@ -4768,5 +4782,5 @@ NgxUtilsModule.decorators = [
|
|
|
4768
4782
|
* Generated bundle index. Do not edit.
|
|
4769
4783
|
*/
|
|
4770
4784
|
|
|
4771
|
-
export { API_SERVICE, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PromiseService, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, StateService, StaticAuthService, StaticLanguageService, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, pipes as ɵa, directives as ɵb, components as ɵc, providers as ɵd, loadConfig as ɵe, StickyClassDirective as ɵf };
|
|
4785
|
+
export { API_SERVICE, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PromiseService, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, StateService, StaticAuthService, StaticLanguageService, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, pipes as ɵa, directives as ɵb, components as ɵc, providers as ɵd, loadConfig as ɵe, StickyClassDirective as ɵf };
|
|
4772
4786
|
//# sourceMappingURL=stemy-ngx-utils.js.map
|