@stemy/ngx-utils 13.4.2 → 13.5.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.
Files changed (42) hide show
  1. package/bundles/stemy-ngx-utils.umd.js +195 -85
  2. package/bundles/stemy-ngx-utils.umd.js.map +1 -1
  3. package/esm2015/ngx-utils/common-types.js +6 -1
  4. package/esm2015/ngx-utils/pipes/filter.pipe.js +6 -11
  5. package/esm2015/ngx-utils/pipes/find.pipe.js +9 -9
  6. package/esm2015/ngx-utils/services/api.service.js +6 -2
  7. package/esm2015/ngx-utils/services/base-http.service.js +8 -9
  8. package/esm2015/ngx-utils/services/config.service.js +14 -1
  9. package/esm2015/ngx-utils/services/language.service.js +16 -4
  10. package/esm2015/ngx-utils/services/universal.service.js +10 -7
  11. package/esm2015/ngx-utils/utils/object.utils.js +76 -30
  12. package/esm2015/public_api.js +2 -2
  13. package/esm2015/stemy-ngx-utils.js +3 -2
  14. package/esm2020/ngx-utils/common-types.mjs +6 -1
  15. package/esm2020/ngx-utils/components/dynamic-table/dynamic-table.component.mjs +6 -3
  16. package/esm2020/ngx-utils/directives/pagination-item.directive.mjs +3 -2
  17. package/esm2020/ngx-utils/pipes/filter.pipe.mjs +6 -11
  18. package/esm2020/ngx-utils/pipes/find.pipe.mjs +9 -9
  19. package/esm2020/ngx-utils/services/api.service.mjs +6 -2
  20. package/esm2020/ngx-utils/services/base-http.service.mjs +7 -8
  21. package/esm2020/ngx-utils/services/config.service.mjs +14 -1
  22. package/esm2020/ngx-utils/services/language.service.mjs +15 -4
  23. package/esm2020/ngx-utils/services/universal.service.mjs +10 -7
  24. package/esm2020/ngx-utils/utils/object.utils.mjs +76 -28
  25. package/esm2020/public_api.mjs +2 -2
  26. package/fesm2015/stemy-ngx-utils.js +143 -65
  27. package/fesm2015/stemy-ngx-utils.js.map +1 -1
  28. package/fesm2015/stemy-ngx-utils.mjs +149 -66
  29. package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
  30. package/fesm2020/stemy-ngx-utils.mjs +148 -66
  31. package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
  32. package/ngx-utils/common-types.d.ts +10 -1
  33. package/ngx-utils/components/dynamic-table/dynamic-table.component.d.ts +2 -1
  34. package/ngx-utils/pipes/find.pipe.d.ts +1 -1
  35. package/ngx-utils/services/base-http.service.d.ts +1 -0
  36. package/ngx-utils/services/config.service.d.ts +1 -0
  37. package/ngx-utils/services/language.service.d.ts +3 -3
  38. package/ngx-utils/services/universal.service.d.ts +3 -2
  39. package/ngx-utils/utils/object.utils.d.ts +3 -0
  40. package/package.json +2 -2
  41. package/public_api.d.ts +1 -1
  42. package/stemy-ngx-utils.metadata.json +1 -1
@@ -27,11 +27,17 @@ export interface ITranslation {
27
27
  export interface ITranslations {
28
28
  [key: string]: any;
29
29
  }
30
+ export interface ILanguageSetting {
31
+ unavailable?: string;
32
+ [key: string]: string | boolean | number;
33
+ }
30
34
  export interface ILanguageSettings {
31
35
  languages: string[];
32
36
  devLanguages: string[];
33
37
  defaultLanguage: string;
34
- settings?: any;
38
+ settings?: {
39
+ [lang: string]: ILanguageSetting;
40
+ };
35
41
  }
36
42
  export interface ILanguageService {
37
43
  currentLanguage: string;
@@ -154,6 +160,7 @@ export interface ISearchObservable {
154
160
  getSearchResults(token: string): Promise<any[]>;
155
161
  }
156
162
  export declare function FactoryDependencies(...dependencies: Array<InjectionToken<any> | Provider>): MethodDecorator;
163
+ export declare function ObjectType(type: string): ClassDecorator;
157
164
  export interface ITimer {
158
165
  id?: any;
159
166
  func?: Function;
@@ -301,6 +308,8 @@ export interface IConfigService {
301
308
  readonly config: IConfiguration;
302
309
  readonly injector: Injector;
303
310
  readonly load: () => Promise<IConfiguration>;
311
+ readonly rootElement: any;
312
+ cloneRootElem(): any;
304
313
  prepareUrl(url: string, ending: string): string;
305
314
  getConfigValue(key: string): any;
306
315
  getQueryParameter(name: string, url?: string): string;
@@ -16,6 +16,7 @@ export declare class DynamicTableComponent implements AfterContentInit, AfterVie
16
16
  boundaryLinks: boolean;
17
17
  orderBy: string;
18
18
  orderDescending: boolean;
19
+ testId: string;
19
20
  tableId: string;
20
21
  templates: ITableTemplates;
21
22
  filter: string;
@@ -42,5 +43,5 @@ export declare class DynamicTableComponent implements AfterContentInit, AfterVie
42
43
  loadData: (page: number, itemsPerPage: number) => Promise<IPaginationData>;
43
44
  private loadLocalData;
44
45
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicTableComponent, never>;
45
- static ɵcmp: i0.ɵɵComponentDeclaration<DynamicTableComponent, "dynamic-table", never, { "label": "label"; "placeholder": "placeholder"; "dataLoader": "dataLoader"; "data": "data"; "parallelData": "parallelData"; "columns": "columns"; "showFilter": "showFilter"; "itemsPerPage": "itemsPerPage"; "updateTime": "updateTime"; "maxPages": "maxPages"; "directionLinks": "directionLinks"; "boundaryLinks": "boundaryLinks"; "orderBy": "orderBy"; "orderDescending": "orderDescending"; }, {}, ["rowTemplate", "wrapperTemplate", "filterTemplate", "templateDirectives"], never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicTableComponent, "dynamic-table", never, { "label": "label"; "placeholder": "placeholder"; "dataLoader": "dataLoader"; "data": "data"; "parallelData": "parallelData"; "columns": "columns"; "showFilter": "showFilter"; "itemsPerPage": "itemsPerPage"; "updateTime": "updateTime"; "maxPages": "maxPages"; "directionLinks": "directionLinks"; "boundaryLinks": "boundaryLinks"; "orderBy": "orderBy"; "orderDescending": "orderDescending"; "testId": "testId"; }, {}, ["rowTemplate", "wrapperTemplate", "filterTemplate", "templateDirectives"], never>;
46
47
  }
@@ -2,7 +2,7 @@ import { PipeTransform } from "@angular/core";
2
2
  import * as i0 from "@angular/core";
3
3
  export declare function defaultFilter(): boolean;
4
4
  export declare class FindPipe implements PipeTransform {
5
- transform(values: any[], filter?: any, params?: any): any[];
5
+ transform(values: any[], filter?: any, params?: any): any;
6
6
  static ɵfac: i0.ɵɵFactoryDeclaration<FindPipe, never>;
7
7
  static ɵpipe: i0.ɵɵPipeDeclaration<FindPipe, "find">;
8
8
  }
@@ -36,6 +36,7 @@ export declare class BaseHttpService implements IHttpService {
36
36
  protected toastWarning(message: string, issueContext: IIssueContext, reason: any, options: IRequestOptions): void;
37
37
  protected toastError(message: string, issueContext: IIssueContext, reason: any, options: IRequestOptions): void;
38
38
  protected toPromise(url: string, options: IRequestOptions, listener?: ProgressListener): HttpPromise;
39
+ protected getUserTokenTime(): number;
39
40
  protected pushFailedRequest(url: string, options: IRequestOptions, req: () => void): boolean;
40
41
  protected checkHeaders(headers: any): boolean;
41
42
  protected makeOptions(options?: IRequestOptions, method?: string, body?: any): IRequestOptions;
@@ -21,6 +21,7 @@ export declare class ConfigService implements IConfigService {
21
21
  protected initService(): void;
22
22
  protected loadJson(): Promise<IConfiguration>;
23
23
  protected prepareConfig(config: IConfiguration): Promise<IConfiguration>;
24
+ cloneRootElem(): any;
24
25
  prepareUrl(url: string, ending: string): string;
25
26
  getConfigValue(key: string): any;
26
27
  getQueryParameter(name: string, url?: string): string;
@@ -1,5 +1,5 @@
1
1
  import { BehaviorSubject, Observable } from "rxjs";
2
- import { ILanguageSettings, ITranslations } from "../common-types";
2
+ import { ILanguageSetting, ILanguageSettings, ITranslations } from "../common-types";
3
3
  import { StaticLanguageService } from "./static-language.service";
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class LanguageService extends StaticLanguageService {
@@ -8,8 +8,8 @@ export declare class LanguageService extends StaticLanguageService {
8
8
  protected languageSettings: BehaviorSubject<ILanguageSettings>;
9
9
  get currentLanguage(): string;
10
10
  set currentLanguage(lang: string);
11
- get settings(): ILanguageSettings;
12
- get $settings(): Observable<any>;
11
+ get settings(): ILanguageSetting;
12
+ get $settings(): Observable<ILanguageSetting>;
13
13
  protected initService(): void;
14
14
  initFromSettings(): Promise<any>;
15
15
  getTranslation(key: string, params?: any): Promise<string>;
@@ -4,8 +4,8 @@ import * as i0 from "@angular/core";
4
4
  * Use this service to determine which is the current environment
5
5
  */
6
6
  export declare class UniversalService {
7
- private platformId;
8
- private dds;
7
+ readonly platformId: string;
8
+ readonly dds: DeviceDetectorService;
9
9
  get isBrowser(): boolean;
10
10
  get isServer(): boolean;
11
11
  get deviceInfo(): DeviceInfo;
@@ -22,6 +22,7 @@ export declare class UniversalService {
22
22
  get isCrawler(): boolean;
23
23
  private readonly crawler;
24
24
  constructor(platformId: string, dds: DeviceDetectorService);
25
+ protected checkBrowser(name: string): boolean;
25
26
  static ɵfac: i0.ɵɵFactoryDeclaration<UniversalService, never>;
26
27
  static ɵprov: i0.ɵɵInjectableDeclaration<UniversalService>;
27
28
  }
@@ -1,5 +1,7 @@
1
1
  export declare type FilterPredicate = (value: any, key?: any, target?: any, source?: any) => boolean;
2
2
  export declare type IterateCallback = (value: any, key?: any) => void;
3
+ export declare function defaultPredicate(value: any, key?: any, target?: any, source?: any): boolean;
4
+ export declare function shouldCopyDefault(key: any, value: any): boolean;
3
5
  export declare class ObjectUtils {
4
6
  static compare(a: any, b: any): number;
5
7
  static getProperties(obj: any): string[];
@@ -25,6 +27,7 @@ export declare class ObjectUtils {
25
27
  static isNumber(value: any): value is number;
26
28
  static isArray(value: any): value is Array<any>;
27
29
  static isSet(value: any): value is Set<any>;
30
+ static isConstructor(value: any): boolean;
28
31
  static checkInterface(obj: any, interFaceObject: any): boolean;
29
32
  static isInterface(obj: any, interFaceObject: any): boolean;
30
33
  static pad(obj: any, width: number, chr?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-utils",
3
- "version": "13.4.2",
3
+ "version": "13.5.0",
4
4
  "license": "MIT",
5
5
  "public": true,
6
6
  "repository": "https://github.com/stemyke/ngx-utils.git",
@@ -17,7 +17,7 @@
17
17
  "express": "^4.0.0",
18
18
  "element-resize-detector": "^1.2.4",
19
19
  "core-js": "^3.6.5 || ^3.22.5",
20
- "rxjs": "^6.6.2 || ^7.5.0",
20
+ "rxjs": "^6.6.2 || ^7.8.1",
21
21
  "zone.js": "^0.10.3 || ^0.11.4 || ^0.11.5",
22
22
  "moment": "^2.27.0",
23
23
  "invokable": "^1.0.3",
package/public_api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, UnorederedListTemplate, UnorderedListTemplates, UnorderedListStyle, IAjaxRequestDetails, AjaxRequestCallback, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IHttpHeaders, IHttpParams, IRequestOptions, IIssueContext, IProgress, ProgressListener, PromiseExecutor, HttpPromise, IHttpService, EXPRESS_REQUEST, IApiService, API_SERVICE, IOpenApiSchemaProperty, IOpenApiSchema, IOpenApiSchemas, ITableColumns, ITableTemplate, ITableTemplates, TableDataLoader, ResourceIfContext, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, RESIZE_DELAY, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, IGlobalTemplates, GLOBAL_TEMPLATES, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
1
+ export { IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, UnorederedListTemplate, UnorderedListTemplates, UnorderedListStyle, IAjaxRequestDetails, AjaxRequestCallback, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IHttpHeaders, IHttpParams, IRequestOptions, IIssueContext, IProgress, ProgressListener, PromiseExecutor, HttpPromise, IHttpService, EXPRESS_REQUEST, IApiService, API_SERVICE, IOpenApiSchemaProperty, IOpenApiSchema, IOpenApiSchemas, ITableColumns, ITableTemplate, ITableTemplates, TableDataLoader, ResourceIfContext, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, RESIZE_DELAY, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, IGlobalTemplates, GLOBAL_TEMPLATES, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
2
2
  export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
3
3
  export { ObjectUtils } from "./ngx-utils/utils/object.utils";
4
4
  export { DateUtils } from "./ngx-utils/utils/date.utils";