@stemy/ngx-utils 19.7.8 → 19.7.9

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.
@@ -47,6 +47,7 @@ export interface IIconService {
47
47
  isDisabled: boolean;
48
48
  iconsLoaded: EventEmitter<any>;
49
49
  getIcon(icon: string, activeIcon: string, active: boolean): Promise<string>;
50
+ getIconImage(icon: string, modifier?: SvgSourceModifier): Promise<HTMLImageElement>;
50
51
  }
51
52
  export interface ITranslation {
52
53
  lang: string;
@@ -462,6 +463,12 @@ export interface IHttpService {
462
463
  url(url: string): string;
463
464
  makeListParams(page: number, itemsPerPage: number, orderBy?: string, orderDescending?: boolean, filter?: string): HttpRequestQuery;
464
465
  }
466
+ export interface SvgDefinition {
467
+ source: SVGSVGElement;
468
+ width: number;
469
+ height: number;
470
+ }
471
+ export type SvgSourceModifier = (svg: SVGSVGElement, width: number, height: number) => string;
465
472
  export interface IBaseHttpClient extends HttpClient {
466
473
  readonly requestHeaders: HttpRequestHeaders;
467
474
  readonly requestParams: HttpRequestQuery;
@@ -90,16 +90,16 @@ export declare class InteractiveCanvasComponent implements InteractiveCanvas, On
90
90
  tempPaint(cb: CanvasPaintFunc): Promise<void>;
91
91
  resize(): void;
92
92
  onTouchStart($event: TouchEvent): void;
93
- onTouchEnd($event: TouchEvent): void;
93
+ onTouchEnd(): void;
94
94
  onMouseDown($event: MouseEvent): void;
95
- onMouseUp($event: MouseEvent): void;
95
+ onMouseUp(): void;
96
96
  onMouseMove($event: MouseEvent): void;
97
97
  onMouseLeave(): void;
98
98
  onPanStart(): void;
99
99
  onPanMove($event: any): void;
100
100
  onPanEnd(): void;
101
101
  protected fixRotation(): void;
102
- protected selectItem(pointer: InteractiveCanvasPointer): void;
102
+ protected selectItem(): void;
103
103
  protected toCanvasPoint(pointer: InteractiveCanvasPointer): Point;
104
104
  protected getIndexUnderPointer(pointer: InteractiveCanvasPointer): number;
105
105
  protected updateCursor(): void;
@@ -38,6 +38,7 @@ export declare class InteractiveItemComponent implements OnChanges, InteractiveC
38
38
  moveY(y: number): void;
39
39
  moveEnd(): void;
40
40
  protected restrictPosition(x: number, y: number): IPoint;
41
+ protected checkIsValid(): boolean;
41
42
  protected isValidByParams(): boolean;
42
43
  protected isValidByDistance(other: InteractiveCanvasItem): boolean;
43
44
  protected distToPixels(value: number): number;
@@ -64,7 +64,7 @@ import { UploadComponent } from "./components/upload/upload.component";
64
64
  export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
65
65
  export declare const directives: (typeof AsyncMethodBase | typeof AsyncMethodTargetDirective | 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 TabsItemDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective)[];
66
66
  export declare const components: (typeof ChipsComponent | typeof CloseBtnComponent | typeof DropListComponent | typeof DynamicTableComponent | typeof PaginationMenuComponent | typeof UnorderedListComponent | typeof UploadComponent)[];
67
- 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 CacheService | typeof ComponentLoaderService | typeof TranslatedUrlSerializer | typeof UniversalService | typeof DeviceDetectorService | {
67
+ export declare const providers: (typeof UniversalService | typeof StateService | typeof AuthGuard | typeof EventsService | typeof AclService | typeof BaseHttpClient | typeof StorageService | typeof CacheService | typeof BaseHttpService | typeof StaticAuthService | typeof ConfigService | typeof BaseDialogService | typeof ErrorHandlerService | 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 | {
68
68
  provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
69
69
  useClass: typeof DragDropEventPlugin;
70
70
  multi: boolean;
@@ -1,13 +1,17 @@
1
1
  import { EventEmitter } from "@angular/core";
2
- import { IIconService } from "../common-types";
2
+ import { IIconService, SvgSourceModifier } from "../common-types";
3
+ import { LocalHttpService } from "./local-http.service";
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class IconService implements IIconService {
6
+ readonly http: LocalHttpService;
5
7
  get isDisabled(): boolean;
6
8
  set isDisabled(value: boolean);
7
9
  readonly iconsLoaded: EventEmitter<any>;
8
10
  protected disabled: boolean;
9
- constructor();
11
+ constructor(http: LocalHttpService);
10
12
  getIcon(icon: string, activeIcon: string, active: boolean): Promise<string>;
13
+ getIconUrl(icon: string, modifier?: SvgSourceModifier): Promise<string>;
14
+ getIconImage(icon: string, modifier?: SvgSourceModifier): Promise<HTMLImageElement>;
11
15
  static ɵfac: i0.ɵɵFactoryDeclaration<IconService, never>;
12
16
  static ɵprov: i0.ɵɵInjectableDeclaration<IconService>;
13
17
  }
@@ -1,8 +1,9 @@
1
- import { HttpClientRequestOptions, IConfiguration } from "../common-types";
1
+ import { HttpClientRequestOptions, IConfiguration, SvgDefinition, SvgSourceModifier } from "../common-types";
2
2
  import { BaseHttpService } from "./base-http.service";
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class LocalHttpService extends BaseHttpService {
5
- private images;
5
+ protected svgs: Record<string, SvgDefinition>;
6
+ protected images: Record<string, Promise<HTMLImageElement>>;
6
7
  get name(): string;
7
8
  get config(): IConfiguration;
8
9
  protected get withCredentials(): boolean;
@@ -10,6 +11,10 @@ export declare class LocalHttpService extends BaseHttpService {
10
11
  url(url: string): string;
11
12
  get(url: string, options?: HttpClientRequestOptions, body?: any): Promise<any>;
12
13
  getImage(url: string): Promise<HTMLImageElement>;
14
+ svgUrlFromSource(sourceStr: string, modifier?: SvgSourceModifier): string;
15
+ svgFromSource(sourceStr: string, modifier?: SvgSourceModifier): Promise<HTMLImageElement>;
16
+ getSvgUrl(url: string, modifier?: SvgSourceModifier): Promise<string>;
17
+ getSvgImage(url: string, modifier?: SvgSourceModifier): Promise<HTMLImageElement>;
13
18
  static ɵfac: i0.ɵɵFactoryDeclaration<LocalHttpService, never>;
14
19
  static ɵprov: i0.ɵɵInjectableDeclaration<LocalHttpService>;
15
20
  }
@@ -8,7 +8,6 @@ export declare class FileUtils {
8
8
  static saveBlob(blob: Blob, fileName: string): void;
9
9
  static saveJson(json: any, fileName: string): void;
10
10
  static readFileAsText(file: Blob): Promise<string>;
11
- static readFileAsBinaryString(file: Blob): Promise<string>;
12
11
  static readFileAsDataURL(file: Blob): Promise<string>;
13
12
  static base64ToBlob(base64: string, mimeType?: string): Blob;
14
13
  static readBlobFromUrl(http: HttpClient, url: string): Promise<Blob>;
@@ -1,3 +1,4 @@
1
+ export declare function svgToDataUri(svgString: string): string;
1
2
  export declare class StringUtils {
2
3
  static concat(separator: string, ...strings: string[]): string;
3
4
  static startsWith(str: string, ...starts: string[]): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-utils",
3
- "version": "19.7.8",
3
+ "version": "19.7.9",
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,6 +1,6 @@
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, TypedClassProvider, TypedTokenProvider, TypedProvider, CachedFactory, ResolveFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService, 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, ShapeIntersection, ShapeDistance, IShape, CanvasResizeMode, CanvasItemDirection, CanvasPaintFunc, RangeCoords, RectCoords, InteractiveCanvasParams, InteractiveCanvasItem, InteractiveCanvasItems, InteractiveCanvas, InteractiveCanvasRenderer, 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, TableDataItems, 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, ResolveFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService, 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, ShapeIntersection, ShapeDistance, IShape, CanvasResizeMode, CanvasItemDirection, CanvasPaintFunc, RangeCoords, RectCoords, InteractiveCanvasParams, InteractiveCanvasItem, InteractiveCanvasItems, InteractiveCanvas, InteractiveCanvasRenderer, InteractivePanEvent, InteractiveCanvasPointer, HttpRequestHeaders, HttpRequestQuery, HttpClientRequestOptions, HttpRequestOptions, UploadData, IIssueContext, IProgress, ProgressListener, CacheExpireMode, IHttpService, SvgSourceModifier, IApiService, DynamicSchemaRef, OpenApiSchemaProperty, OpenApiSchema, OpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataItems, 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, 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";
@@ -22,7 +22,7 @@ export { isBrowser, getRoot, hashCode, switchClass, getCssVariables, checkTransi
22
22
  export { ObjectUtils } from "./ngx-utils/utils/object.utils";
23
23
  export { ObservableUtils, ISubscriberInfo } from "./ngx-utils/utils/observable.utils";
24
24
  export { CancelablePromise, cancelablePromise, impatientPromise } from "./ngx-utils/utils/promise.utils";
25
- export { StringUtils } from "./ngx-utils/utils/string.utils";
25
+ export { svgToDataUri, StringUtils } from "./ngx-utils/utils/string.utils";
26
26
  export { SetUtils } from "./ngx-utils/utils/set.utils";
27
27
  export { computedPrevious, cssStyles, cssVariables } from "./ngx-utils/utils/signal-utils";
28
28
  export { SocketFactory, SocketData, SocketDataValue, SocketDataObj, SocketClient } from "./ngx-utils/utils/socket-client";