@stemy/ngx-utils 19.6.8 → 19.6.10

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.
@@ -13,9 +13,15 @@ export interface TypedValueProvider<T> {
13
13
  useValue: T;
14
14
  }
15
15
  export interface TypedExistingProvider<T> {
16
- useExisting: T;
16
+ useExisting: Type<T>;
17
17
  }
18
- export type TypedProvider<T> = Type<T> | TypedFactoryProvider<T> | TypedValueProvider<T> | TypedExistingProvider<T>;
18
+ export interface TypedClassProvider<T> {
19
+ useClass: Type<T>;
20
+ }
21
+ export interface TypedTokenProvider<T> {
22
+ useToken: InjectionToken<T>;
23
+ }
24
+ export type TypedProvider<T> = TypedFactoryProvider<T> | TypedValueProvider<T> | TypedExistingProvider<T> | TypedClassProvider<T> | TypedTokenProvider<T> | Type<T>;
19
25
  export type CachedFactory<T> = (injector: Injector) => ReadonlyArray<T>;
20
26
  export interface IResolveFactory {
21
27
  func: Function;
@@ -132,14 +138,10 @@ export interface IDialogConfig {
132
138
  [id: string]: TemplateRef<any>;
133
139
  };
134
140
  }
135
- export interface IConfirmDialogConfig {
141
+ export interface IConfirmMessageConfig {
136
142
  id?: string;
137
143
  title?: string;
138
- message: string;
139
144
  messageContext?: any;
140
- buttons?: IDialogButtonConfig[];
141
- method?: AsyncMethod;
142
- cancelMethod?: AsyncMethod;
143
145
  size?: string;
144
146
  templates?: {
145
147
  [id: string]: TemplateRef<any>;
@@ -149,9 +151,15 @@ export interface IConfirmDialogConfig {
149
151
  cancelText?: string;
150
152
  cancelClasses?: string;
151
153
  }
154
+ export interface IConfirmDialogConfig extends IConfirmMessageConfig {
155
+ message: string;
156
+ method?: AsyncMethod;
157
+ cancelMethod?: AsyncMethod;
158
+ }
152
159
  export interface IDialogService<DR = any> {
153
160
  dialog(config: IDialogConfig): DR;
154
161
  confirm(config: IConfirmDialogConfig): DR;
162
+ confirmMsg(message: string, config?: IConfirmMessageConfig): Promise<boolean>;
155
163
  }
156
164
  export interface IPromiseService {
157
165
  zone: NgZone;
@@ -1,10 +1,11 @@
1
- import { IConfirmDialogConfig, IDialogConfig, IDialogService, IToasterService } from "../common-types";
1
+ import { IConfirmMessageConfig, IConfirmDialogConfig, IDialogConfig, IDialogService, IToasterService } from "../common-types";
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class BaseDialogService<DR = any> implements IDialogService<DR> {
4
4
  readonly toaster: IToasterService;
5
5
  constructor(toaster: IToasterService);
6
6
  dialog(config: IDialogConfig): DR;
7
7
  confirm(config: IConfirmDialogConfig): DR;
8
+ confirmMsg(message: string, config?: IConfirmMessageConfig): Promise<boolean>;
8
9
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseDialogService<any>, never>;
9
10
  static ɵprov: i0.ɵɵInjectableDeclaration<BaseDialogService<any>>;
10
11
  }
@@ -1,2 +1,4 @@
1
+ import { InjectionToken, Provider } from "@angular/core";
1
2
  import { CachedFactory, TypedProvider } from "../common-types";
3
+ export declare function createTypedProvider<T>(provide: InjectionToken<T>, p: TypedProvider<T>, multi?: boolean): Provider;
2
4
  export declare function cachedFactory<T>(providers: TypedProvider<T>[]): CachedFactory<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-utils",
3
- "version": "19.6.8",
3
+ "version": "19.6.10",
4
4
  "license": "MIT",
5
5
  "public": true,
6
6
  "repository": "https://github.com/stemyke/ngx-utils.git",
package/public_api.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import "zone.js";
2
2
  export { MaybePromise, MaybeArray, KeysOfType, ObjOfType, StringKeys, CapitalizeFirst, CamelJoin, PrefixedPick } from "./ngx-utils/helper-types";
3
- export { DurationUnit, TypedFactoryProvider, TypedValueProvider, TypedExistingProvider, TypedProvider, CachedFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmDialogConfig, IDialogService, IPromiseService, IWasi, IWasmExports, IWasm, IWasmAsync, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, IAsyncMessage, AsyncMethod, IconMap, IconProps, ButtonType, ButtonSize, ButtonProps, TabValue, TabOption, ChipValue, ChipStatus, ChipOption, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, UploadType, IFileUploadResult, IFileUploadProcess, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, ILoadableElement, ILoaderPromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IPoint, IShape, CanvasItemShape, CanvasItemDirection, InteractiveCanvas, InteractiveCanvasItem, InteractiveDrawFn, InteractivePanEvent, InteractiveCanvasPointer, HttpRequestHeaders, HttpRequestQuery, HttpClientRequestOptions, HttpRequestOptions, UploadData, IIssueContext, IProgress, ProgressListener, CacheExpireMode, IHttpService, IApiService, DynamicSchemaRef, OpenApiSchemaProperty, OpenApiSchema, OpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, IConfiguration, IConfigService, ResizeEventStrategy, ErrorHandlerCallback, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
3
+ export { DurationUnit, TypedFactoryProvider, TypedValueProvider, TypedExistingProvider, TypedClassProvider, TypedTokenProvider, TypedProvider, CachedFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService, IWasi, IWasmExports, IWasm, IWasmAsync, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, IAsyncMessage, AsyncMethod, IconMap, IconProps, ButtonType, ButtonSize, ButtonProps, TabValue, TabOption, ChipValue, ChipStatus, ChipOption, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, UploadType, IFileUploadResult, IFileUploadProcess, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, ILoadableElement, ILoaderPromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IPoint, IShape, CanvasItemShape, CanvasItemDirection, InteractiveCanvas, InteractiveCanvasItem, InteractiveDrawFn, InteractivePanEvent, InteractiveCanvasPointer, HttpRequestHeaders, HttpRequestQuery, HttpClientRequestOptions, HttpRequestOptions, UploadData, IIssueContext, IProgress, ProgressListener, CacheExpireMode, IHttpService, IApiService, DynamicSchemaRef, OpenApiSchemaProperty, OpenApiSchema, OpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, IConfiguration, IConfigService, ResizeEventStrategy, ErrorHandlerCallback, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
4
4
  export { ICON_TYPE, ICON_MAP, BUTTON_TYPE, ERROR_HANDLER, STATIC_SCHEMAS, RESIZE_STRATEGY, RESIZE_DELAY, ROOT_ELEMENT, SCRIPT_PARAMS, BASE_CONFIG, CONFIG_SERVICE, APP_BASE_URL, API_SERVICE, EXPRESS_REQUEST, WASI_IMPLEMENTATION, PROMISE_SERVICE, DIALOG_SERVICE, TOASTER_SERVICE, AUTH_SERVICE, LANGUAGE_SERVICE, ICON_SERVICE, OPTIONS_TOKEN } from "./ngx-utils/tokens";
5
5
  export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
6
6
  export { ArrayUtils } from "./ngx-utils/utils/array.utils";
7
7
  export { AuthGuard } from "./ngx-utils/utils/auth.guard";
8
- export { cachedFactory } from "./ngx-utils/utils/cached-factory";
8
+ export { createTypedProvider, cachedFactory } from "./ngx-utils/utils/cached-factory";
9
9
  export { CanvasUtils } from "./ngx-utils/utils/canvas.utils";
10
10
  export { DateUtils } from "./ngx-utils/utils/date.utils";
11
11
  export { FileUtils } from "./ngx-utils/utils/file.utils";