@stemy/ngx-utils 19.4.0 → 19.4.1

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.
@@ -188,7 +188,7 @@ export interface IAsyncMessage {
188
188
  message: string;
189
189
  context?: any;
190
190
  }
191
- export type AsyncMethod = (context?: any) => Promise<IAsyncMessage>;
191
+ export type AsyncMethod = (context?: any, ev?: MouseEvent) => Promise<IAsyncMessage>;
192
192
  export type DropdownAttachTo = "root" | HTMLElement | ElementRef<HTMLElement> | null;
193
193
  export interface UnorderedListTemplate {
194
194
  readonly type: string;
@@ -199,12 +199,14 @@ export interface UnorderedListTemplates {
199
199
  [type: string]: TemplateRef<any>;
200
200
  }
201
201
  export type UnorderedListStyle = "table" | "list";
202
+ export type UploadType = string | Blob;
202
203
  export interface IFileUploadResult {
203
204
  _id?: string;
204
205
  id?: string;
205
206
  contentType?: string;
206
207
  createdAt?: Date;
207
208
  filename?: string;
209
+ file?: Blob;
208
210
  }
209
211
  export interface IFileUploadProcess {
210
212
  file: File;
@@ -1,14 +1,15 @@
1
1
  import { ChangeDetectorRef, EventEmitter, OnChanges, TemplateRef } from "@angular/core";
2
2
  import { ControlValueAccessor } from "@angular/forms";
3
- import { IApiService, IFileUploadProcess, IFileUploadResult, IToasterService } from "../../common-types";
3
+ import { IApiService, IFileUploadProcess, IFileUploadResult, IToasterService, UploadType } from "../../common-types";
4
4
  import { BaseHttpClient } from "../../services/base-http.client";
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class UploadComponent implements ControlValueAccessor, OnChanges {
7
7
  private cdr;
8
8
  private api;
9
9
  private toaster;
10
- value: string | string[];
10
+ value: UploadType | UploadType[];
11
11
  disabled: boolean;
12
+ inline: boolean;
12
13
  accept: string | string[];
13
14
  baseUrl: string;
14
15
  message: string;
@@ -17,7 +18,7 @@ export declare class UploadComponent implements ControlValueAccessor, OnChanges
17
18
  makeUpload: (f: File) => any;
18
19
  preProcess: (f: File) => boolean;
19
20
  onUploaded: EventEmitter<IFileUploadResult[]>;
20
- onRemove: EventEmitter<string[]>;
21
+ onRemove: EventEmitter<UploadType[]>;
21
22
  acceptAttr: string;
22
23
  isImage: boolean;
23
24
  dropAllowed: boolean;
@@ -26,7 +27,7 @@ export declare class UploadComponent implements ControlValueAccessor, OnChanges
26
27
  onTouched: Function;
27
28
  remove: (index?: number) => void;
28
29
  uploadButton: TemplateRef<any>;
29
- protected fileImageCache: any[];
30
+ protected fileImageCache: Map<Blob, string>;
30
31
  protected acceptTypes: string[];
31
32
  get http(): BaseHttpClient;
32
33
  constructor(cdr: ChangeDetectorRef, api: IApiService, toaster: IToasterService);
@@ -35,7 +36,7 @@ export declare class UploadComponent implements ControlValueAccessor, OnChanges
35
36
  ngOnChanges(): void;
36
37
  registerOnChange(fn: any): void;
37
38
  registerOnTouched(fn: any): void;
38
- writeValue(value: string | string[]): void;
39
+ writeValue(value: UploadType | UploadType[]): void;
39
40
  setDisabledState(val: boolean): void;
40
41
  onInputClick(ev: MouseEvent): void;
41
42
  onInputChange(ev: Event): void;
@@ -43,5 +44,5 @@ export declare class UploadComponent implements ControlValueAccessor, OnChanges
43
44
  getBgUrl(image: any): string;
44
45
  processFiles(files: File[]): Promise<IFileUploadResult[]>;
45
46
  static ɵfac: i0.ɵɵFactoryDeclaration<UploadComponent, never>;
46
- static ɵcmp: i0.ɵɵComponentDeclaration<UploadComponent, "upload", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "baseUrl": { "alias": "baseUrl"; "required": false; }; "message": { "alias": "message"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "buttonText": { "alias": "buttonText"; "required": false; }; "makeUpload": { "alias": "makeUpload"; "required": false; }; "preProcess": { "alias": "preProcess"; "required": false; }; }, { "onUploaded": "onUploaded"; "onRemove": "onRemove"; }, ["uploadButton"], never, false, never>;
47
+ static ɵcmp: i0.ɵɵComponentDeclaration<UploadComponent, "upload", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "inline": { "alias": "inline"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "baseUrl": { "alias": "baseUrl"; "required": false; }; "message": { "alias": "message"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "buttonText": { "alias": "buttonText"; "required": false; }; "makeUpload": { "alias": "makeUpload"; "required": false; }; "preProcess": { "alias": "preProcess"; "required": false; }; }, { "onUploaded": "onUploaded"; "onRemove": "onRemove"; }, ["uploadButton"], never, false, never>;
47
48
  }
@@ -14,8 +14,8 @@ export declare class AsyncMethodBase implements OnChanges {
14
14
  constructor(toaster: IToasterService, cdr: ChangeDetectorRef);
15
15
  protected getMethod(): AsyncMethod;
16
16
  ngOnChanges(): void;
17
- click(ev: Event): boolean;
18
- callMethod(): boolean;
17
+ click(ev: MouseEvent): boolean;
18
+ callMethod(ev: MouseEvent): boolean;
19
19
  static ɵfac: i0.ɵɵFactoryDeclaration<AsyncMethodBase, never>;
20
20
  static ɵdir: i0.ɵɵDirectiveDeclaration<AsyncMethodBase, "[__asmb__]", never, { "disabled": { "alias": "disabled"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, { "onSuccess": "onSuccess"; "onError": "onError"; }, never, never, false, never>;
21
21
  }
@@ -10,7 +10,7 @@ export declare class DropdownToggleDirective extends AsyncMethodBase {
10
10
  switch: boolean;
11
11
  constructor(element: ElementRef, dropdown: DropdownDirective, toaster: IToasterService, cdr: ChangeDetectorRef);
12
12
  protected getMethod(): AsyncMethod;
13
- callMethod(): boolean;
13
+ callMethod(ev: MouseEvent): boolean;
14
14
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownToggleDirective, never>;
15
15
  static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownToggleDirective, "[dropdownToggle]", ["dropdown-toggle"], { "beforeOpen": { "alias": "beforeOpen"; "required": false; }; "switch": { "alias": "switch"; "required": false; }; }, {}, never, never, false, never>;
16
16
  }
@@ -1,8 +1,10 @@
1
- import { EventEmitter, NgZone, OnChanges, SimpleChanges } from "@angular/core";
1
+ import { ElementRef, EventEmitter, NgZone, OnChanges, Renderer2, SimpleChanges } from "@angular/core";
2
2
  import { PaginationDataLoader } from "../common-types";
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class PaginationDirective implements OnChanges {
5
- private zone;
5
+ readonly zone: NgZone;
6
+ readonly renderer: Renderer2;
7
+ readonly element: ElementRef;
6
8
  get total(): number;
7
9
  get items(): any[];
8
10
  loader: PaginationDataLoader;
@@ -15,7 +17,7 @@ export declare class PaginationDirective implements OnChanges {
15
17
  maxPage: number;
16
18
  private data;
17
19
  private updateTimer;
18
- constructor(zone: NgZone);
20
+ constructor(zone: NgZone, renderer: Renderer2, element: ElementRef);
19
21
  ngOnChanges(changes: SimpleChanges): void;
20
22
  refresh(time?: number): void;
21
23
  paginate(page: number): void;
@@ -61,8 +61,8 @@ import { UnorderedListComponent } from "./components/unordered-list/unordered-li
61
61
  import { UploadComponent } from "./components/upload/upload.component";
62
62
  export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
63
63
  export declare const directives: (typeof AsyncMethodBase | typeof BackgroundDirective | typeof ComponentLoaderDirective | typeof DynamicTableTemplateDirective | typeof GlobalTemplateDirective | typeof IconDirective | typeof NgxTemplateOutletDirective | typeof PaginationDirective | typeof PaginationItemDirective | typeof ResourceIfDirective | typeof StickyDirective | typeof StickyClassDirective | typeof DropdownDirective | typeof DropdownContentDirective | typeof DropdownToggleDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective)[];
64
- export declare const components: (typeof DropListComponent | typeof DynamicTableComponent | typeof FakeModuleComponent | typeof PaginationMenuComponent | typeof UnorderedListComponent | typeof UploadComponent)[];
65
- export declare const providers: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof BaseHttpClient | typeof BaseHttpService | typeof AuthGuard | typeof AclService | typeof StaticAuthService | typeof ConfigService | typeof BaseDialogService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof PromiseService | typeof SocketService | typeof StateService | typeof StorageService | typeof BaseToasterService | typeof ComponentLoaderService | typeof TranslatedUrlSerializer | typeof UniversalService | typeof WasmService | typeof DeviceDetectorService | {
64
+ export declare const components: (typeof UploadComponent | typeof DropListComponent | typeof DynamicTableComponent | typeof FakeModuleComponent | typeof PaginationMenuComponent | typeof UnorderedListComponent)[];
65
+ export declare const providers: (typeof UniversalService | typeof StateService | typeof AuthGuard | typeof BaseHttpClient | typeof StorageService | typeof BaseHttpService | typeof WasmService | typeof AclService | typeof StaticAuthService | typeof ConfigService | typeof BaseDialogService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof BaseToasterService | typeof ComponentLoaderService | typeof TranslatedUrlSerializer | typeof PromiseService | typeof SocketService | typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof DeviceDetectorService | {
66
66
  provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
67
67
  useClass: typeof DragDropEventPlugin;
68
68
  multi: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-utils",
3
- "version": "19.4.0",
3
+ "version": "19.4.1",
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,4 +1,4 @@
1
- export { TypedFactoryProvider, TypedValueProvider, CachedProvider, CachedFactory, OPTIONS_TOKEN, IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmDialogConfig, IDialogService, DIALOG_SERVICE, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, IFileUploadProcess, IFileUploadResult, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, 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, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, RESIZE_DELAY, ResizeEventStrategy, RESIZE_STRATEGY, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
1
+ export { TypedFactoryProvider, TypedValueProvider, CachedProvider, CachedFactory, OPTIONS_TOKEN, IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmDialogConfig, IDialogService, DIALOG_SERVICE, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, UploadType, IFileUploadResult, IFileUploadProcess, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, 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, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, RESIZE_DELAY, ResizeEventStrategy, RESIZE_STRATEGY, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
2
2
  export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
3
3
  export { ArrayUtils } from "./ngx-utils/utils/array.utils";
4
4
  export { AuthGuard } from "./ngx-utils/utils/auth.guard";