@stemy/ngx-utils 19.1.3 → 19.2.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/stemy-ngx-utils.mjs +291 -11
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +13 -0
- package/ngx-utils/components/drop-list/drop-list.component.d.ts +2 -1
- package/ngx-utils/components/upload/upload.component.d.ts +44 -0
- package/ngx-utils/ngx-utils.imports.d.ts +3 -2
- package/ngx-utils/ngx-utils.module.d.ts +4 -3
- package/ngx-utils/utils/file.utils.d.ts +2 -0
- package/package.json +1 -1
- package/public_api.d.ts +2 -1
|
@@ -197,6 +197,19 @@ export interface UnorderedListTemplates {
|
|
|
197
197
|
[type: string]: TemplateRef<any>;
|
|
198
198
|
}
|
|
199
199
|
export type UnorderedListStyle = "table" | "list";
|
|
200
|
+
export interface IFileUploadResult {
|
|
201
|
+
_id?: string;
|
|
202
|
+
id?: string;
|
|
203
|
+
contentType?: string;
|
|
204
|
+
createdAt?: Date;
|
|
205
|
+
filename?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface IFileUploadProcess {
|
|
208
|
+
file: File;
|
|
209
|
+
progress: number;
|
|
210
|
+
preview?: string;
|
|
211
|
+
promise?: Promise<void>;
|
|
212
|
+
}
|
|
200
213
|
export interface IAjaxRequestDetails {
|
|
201
214
|
request: XMLHttpRequest;
|
|
202
215
|
method: string;
|
|
@@ -14,6 +14,7 @@ export declare class DropListComponent implements OnChanges, ControlValueAccesso
|
|
|
14
14
|
context: DropListItem[];
|
|
15
15
|
prepareItem: (i: DropListItem) => void;
|
|
16
16
|
checkFn: DragEventHandler<boolean, "data">;
|
|
17
|
+
dropFn: DragEventHandler<boolean, "data">;
|
|
17
18
|
itemTemplate: TemplateRef<any>;
|
|
18
19
|
onChange: Function;
|
|
19
20
|
onTouched: Function;
|
|
@@ -30,6 +31,6 @@ export declare class DropListComponent implements OnChanges, ControlValueAccesso
|
|
|
30
31
|
writeValue(obj: any): void;
|
|
31
32
|
protected changeValue(value: DropListId[]): void;
|
|
32
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropListComponent, never>;
|
|
33
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropListComponent, "drop-list", never, { "disabled": { "alias": "disabled"; "required": false; }; "unique": { "alias": "unique"; "required": false; }; "idField": { "alias": "idField"; "required": false; }; "labelField": { "alias": "labelField"; "required": false; }; "value": { "alias": "value"; "required": false; }; "context": { "alias": "context"; "required": false; }; "prepareItem": { "alias": "prepareItem"; "required": false; }; "checkFn": { "alias": "checkFn"; "required": false; }; }, {}, ["itemTemplate"], never, false, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropListComponent, "drop-list", never, { "disabled": { "alias": "disabled"; "required": false; }; "unique": { "alias": "unique"; "required": false; }; "idField": { "alias": "idField"; "required": false; }; "labelField": { "alias": "labelField"; "required": false; }; "value": { "alias": "value"; "required": false; }; "context": { "alias": "context"; "required": false; }; "prepareItem": { "alias": "prepareItem"; "required": false; }; "checkFn": { "alias": "checkFn"; "required": false; }; "dropFn": { "alias": "dropFn"; "required": false; }; }, {}, ["itemTemplate"], never, false, never>;
|
|
34
35
|
}
|
|
35
36
|
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter, OnChanges, TemplateRef } from "@angular/core";
|
|
2
|
+
import { ControlValueAccessor } from "@angular/forms";
|
|
3
|
+
import { IApiService, IFileUploadProcess, IFileUploadResult, IToasterService } from "../../common-types";
|
|
4
|
+
import { BaseHttpClient } from "../../services/base-http.client";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class UploadComponent implements ControlValueAccessor, OnChanges {
|
|
7
|
+
private cdr;
|
|
8
|
+
private api;
|
|
9
|
+
private toaster;
|
|
10
|
+
value: string | string[];
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
accept: string | string[];
|
|
13
|
+
baseUrl: string;
|
|
14
|
+
multiple: boolean;
|
|
15
|
+
buttonText: string;
|
|
16
|
+
makeUpload: (f: File) => any;
|
|
17
|
+
preProcess: (f: File) => boolean;
|
|
18
|
+
onUploaded: EventEmitter<IFileUploadResult[]>;
|
|
19
|
+
acceptAttr: string;
|
|
20
|
+
isImage: boolean;
|
|
21
|
+
dropAllowed: boolean;
|
|
22
|
+
processing: IFileUploadProcess[];
|
|
23
|
+
onChange: Function;
|
|
24
|
+
onTouched: Function;
|
|
25
|
+
buttonTemplate: TemplateRef<any>;
|
|
26
|
+
protected fileImageCache: any[];
|
|
27
|
+
protected acceptTypes: string[];
|
|
28
|
+
get http(): BaseHttpClient;
|
|
29
|
+
constructor(cdr: ChangeDetectorRef, api: IApiService, toaster: IToasterService);
|
|
30
|
+
onDragEnter(ev: DragEvent): void;
|
|
31
|
+
onDrop(): void;
|
|
32
|
+
ngOnChanges(): void;
|
|
33
|
+
registerOnChange(fn: any): void;
|
|
34
|
+
registerOnTouched(fn: any): void;
|
|
35
|
+
writeValue(value: string | string[]): void;
|
|
36
|
+
setDisabledState(val: boolean): void;
|
|
37
|
+
onInputClick(ev: MouseEvent): void;
|
|
38
|
+
onInputChange(ev: Event): void;
|
|
39
|
+
delete(index?: number): void;
|
|
40
|
+
getUrl(image: any): string;
|
|
41
|
+
processFiles(files: File[]): Promise<IFileUploadResult[]>;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UploadComponent, never>;
|
|
43
|
+
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; }; "multiple": { "alias": "multiple"; "required": false; }; "buttonText": { "alias": "buttonText"; "required": false; }; "makeUpload": { "alias": "makeUpload"; "required": false; }; "preProcess": { "alias": "preProcess"; "required": false; }; }, { "onUploaded": "onUploaded"; }, ["buttonTemplate"], never, false, never>;
|
|
44
|
+
}
|
|
@@ -50,10 +50,11 @@ import { DropListComponent } from "./components/drop-list/drop-list.component";
|
|
|
50
50
|
import { DynamicTableComponent } from "./components/dynamic-table/dynamic-table.component";
|
|
51
51
|
import { PaginationMenuComponent } from "./components/pagination-menu/pagination-menu.component";
|
|
52
52
|
import { UnorderedListComponent } from "./components/unordered-list/unordered-list.component";
|
|
53
|
+
import { UploadComponent } from "./components/upload/upload.component";
|
|
53
54
|
export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
|
|
54
55
|
export declare const directives: (typeof AsyncMethodBase | typeof BackgroundDirective | typeof DynamicTableTemplateDirective | typeof GlobalTemplateDirective | typeof IconDirective | typeof NgxTemplateOutletDirective | typeof PaginationDirective | typeof PaginationItemDirective | typeof ResourceIfDirective | typeof StickyDirective | typeof StickyClassDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective)[];
|
|
55
|
-
export declare const components: (typeof DropListComponent | typeof DynamicTableComponent | typeof PaginationMenuComponent | typeof UnorderedListComponent)[];
|
|
56
|
-
export declare const providers: (typeof
|
|
56
|
+
export declare const components: (typeof DropListComponent | typeof DynamicTableComponent | typeof PaginationMenuComponent | typeof UnorderedListComponent | typeof UploadComponent)[];
|
|
57
|
+
export declare const providers: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | 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 StateService | typeof StorageService | typeof BaseToasterService | typeof TranslatedUrlSerializer | typeof UniversalService | typeof WasmService | typeof DeviceDetectorService | {
|
|
57
58
|
provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
|
|
58
59
|
useClass: typeof DragDropEventPlugin;
|
|
59
60
|
multi: boolean;
|
|
@@ -47,8 +47,9 @@ import * as i43 from "./components/drop-list/drop-list.component";
|
|
|
47
47
|
import * as i44 from "./components/dynamic-table/dynamic-table.component";
|
|
48
48
|
import * as i45 from "./components/pagination-menu/pagination-menu.component";
|
|
49
49
|
import * as i46 from "./components/unordered-list/unordered-list.component";
|
|
50
|
-
import * as i47 from "
|
|
51
|
-
import * as i48 from "@angular/
|
|
50
|
+
import * as i47 from "./components/upload/upload.component";
|
|
51
|
+
import * as i48 from "@angular/common";
|
|
52
|
+
import * as i49 from "@angular/forms";
|
|
52
53
|
export declare function loadBaseUrl(): string;
|
|
53
54
|
export declare function loadBaseHref(baseUrl: string): string;
|
|
54
55
|
export declare class NgxUtilsModule {
|
|
@@ -57,6 +58,6 @@ export declare class NgxUtilsModule {
|
|
|
57
58
|
static provideUtils(config?: IModuleConfig): EnvironmentProviders;
|
|
58
59
|
constructor();
|
|
59
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxUtilsModule, never>;
|
|
60
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxUtilsModule, [typeof i1.ChunkPipe, typeof i2.EntriesPipe, typeof i3.ExtraItemPropertiesPipe, typeof i4.FilterPipe, typeof i5.FindPipe, typeof i6.FormatNumberPipe, typeof i7.GetOffsetPipe, typeof i8.GetTypePipe, typeof i9.GetValuePipe, typeof i10.GlobalTemplatePipe, typeof i11.GroupByPipe, typeof i12.IsTypePipe, typeof i13.JoinPipe, typeof i14.KeysPipe, typeof i15.MapPipe, typeof i16.MaxPipe, typeof i17.MinPipe, typeof i18.PopPipe, typeof i19.ReducePipe, typeof i20.RemapPipe, typeof i21.ReplacePipe, typeof i22.ReversePipe, typeof i23.RoundPipe, typeof i24.SafeHtmlPipe, typeof i25.ShiftPipe, typeof i26.SplitPipe, typeof i27.TranslatePipe, typeof i28.ValuesPipe, typeof i29.AsyncMethodBase, typeof i30.AsyncMethodDirective, typeof i31.BackgroundDirective, typeof i32.DynamicTableTemplateDirective, typeof i33.GlobalTemplateDirective, typeof i34.IconDirective, typeof i35.NgxTemplateOutletDirective, typeof i36.PaginationDirective, typeof i37.PaginationItemDirective, typeof i38.ResourceIfDirective, typeof i39.StickyDirective, typeof i40.StickyClassDirective, typeof i41.UnorderedListItemDirective, typeof i42.UnorderedListTemplateDirective, typeof i43.DropListComponent, typeof i44.DynamicTableComponent, typeof i45.PaginationMenuComponent, typeof i46.UnorderedListComponent], [typeof
|
|
61
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxUtilsModule, [typeof i1.ChunkPipe, typeof i2.EntriesPipe, typeof i3.ExtraItemPropertiesPipe, typeof i4.FilterPipe, typeof i5.FindPipe, typeof i6.FormatNumberPipe, typeof i7.GetOffsetPipe, typeof i8.GetTypePipe, typeof i9.GetValuePipe, typeof i10.GlobalTemplatePipe, typeof i11.GroupByPipe, typeof i12.IsTypePipe, typeof i13.JoinPipe, typeof i14.KeysPipe, typeof i15.MapPipe, typeof i16.MaxPipe, typeof i17.MinPipe, typeof i18.PopPipe, typeof i19.ReducePipe, typeof i20.RemapPipe, typeof i21.ReplacePipe, typeof i22.ReversePipe, typeof i23.RoundPipe, typeof i24.SafeHtmlPipe, typeof i25.ShiftPipe, typeof i26.SplitPipe, typeof i27.TranslatePipe, typeof i28.ValuesPipe, typeof i29.AsyncMethodBase, typeof i30.AsyncMethodDirective, typeof i31.BackgroundDirective, typeof i32.DynamicTableTemplateDirective, typeof i33.GlobalTemplateDirective, typeof i34.IconDirective, typeof i35.NgxTemplateOutletDirective, typeof i36.PaginationDirective, typeof i37.PaginationItemDirective, typeof i38.ResourceIfDirective, typeof i39.StickyDirective, typeof i40.StickyClassDirective, typeof i41.UnorderedListItemDirective, typeof i42.UnorderedListTemplateDirective, typeof i43.DropListComponent, typeof i44.DynamicTableComponent, typeof i45.PaginationMenuComponent, typeof i46.UnorderedListComponent, typeof i47.UploadComponent], [typeof i48.CommonModule, typeof i49.FormsModule], [typeof i1.ChunkPipe, typeof i2.EntriesPipe, typeof i3.ExtraItemPropertiesPipe, typeof i4.FilterPipe, typeof i5.FindPipe, typeof i6.FormatNumberPipe, typeof i7.GetOffsetPipe, typeof i8.GetTypePipe, typeof i9.GetValuePipe, typeof i10.GlobalTemplatePipe, typeof i11.GroupByPipe, typeof i12.IsTypePipe, typeof i13.JoinPipe, typeof i14.KeysPipe, typeof i15.MapPipe, typeof i16.MaxPipe, typeof i17.MinPipe, typeof i18.PopPipe, typeof i19.ReducePipe, typeof i20.RemapPipe, typeof i21.ReplacePipe, typeof i22.ReversePipe, typeof i23.RoundPipe, typeof i24.SafeHtmlPipe, typeof i25.ShiftPipe, typeof i26.SplitPipe, typeof i27.TranslatePipe, typeof i28.ValuesPipe, typeof i29.AsyncMethodBase, typeof i30.AsyncMethodDirective, typeof i31.BackgroundDirective, typeof i32.DynamicTableTemplateDirective, typeof i33.GlobalTemplateDirective, typeof i34.IconDirective, typeof i35.NgxTemplateOutletDirective, typeof i36.PaginationDirective, typeof i37.PaginationItemDirective, typeof i38.ResourceIfDirective, typeof i39.StickyDirective, typeof i40.StickyClassDirective, typeof i41.UnorderedListItemDirective, typeof i42.UnorderedListTemplateDirective, typeof i43.DropListComponent, typeof i44.DynamicTableComponent, typeof i45.PaginationMenuComponent, typeof i46.UnorderedListComponent, typeof i47.UploadComponent, typeof i49.FormsModule]>;
|
|
61
62
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxUtilsModule>;
|
|
62
63
|
}
|
|
@@ -13,5 +13,7 @@ export declare class FileUtils {
|
|
|
13
13
|
static base64ToBlob(base64: string, mimeType?: string): Blob;
|
|
14
14
|
static readBlobFromUrl(http: HttpClient, url: string): Promise<Blob>;
|
|
15
15
|
static readDataFromUrl(http: HttpClient, url: string): Promise<string>;
|
|
16
|
+
static getVideoCover(file: File, seekTo?: number, quality?: number): Promise<string>;
|
|
17
|
+
static getFilePreview(file: File): Promise<string>;
|
|
16
18
|
private static readFile;
|
|
17
19
|
}
|
package/package.json
CHANGED
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, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, 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, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, 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, 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, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, 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";
|
|
@@ -97,4 +97,5 @@ export { DropListComponent } from "./ngx-utils/components/drop-list/drop-list.co
|
|
|
97
97
|
export { DynamicTableComponent } from "./ngx-utils/components/dynamic-table/dynamic-table.component";
|
|
98
98
|
export { PaginationMenuComponent } from "./ngx-utils/components/pagination-menu/pagination-menu.component";
|
|
99
99
|
export { UnorderedListComponent } from "./ngx-utils/components/unordered-list/unordered-list.component";
|
|
100
|
+
export { UploadComponent } from "./ngx-utils/components/upload/upload.component";
|
|
100
101
|
export { NgxUtilsModule } from "./ngx-utils/ngx-utils.module";
|