@stemy/ngx-utils 19.7.9 → 19.7.11

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
+ getIconUrl(icon: string, modifier?: SvgSourceModifier): Promise<string>;
50
51
  getIconImage(icon: string, modifier?: SvgSourceModifier): Promise<HTMLImageElement>;
51
52
  }
52
53
  export interface ITranslation {
@@ -320,6 +321,7 @@ export interface ShapeDistance {
320
321
  }
321
322
  export interface IShape extends IPoint {
322
323
  readonly center: IPoint;
324
+ draw(ctx: CanvasRenderingContext2D, ratio?: number): void;
323
325
  support(dir: IPoint): IPoint;
324
326
  move(pos: IPoint): IShape;
325
327
  intersection(shape: IShape): ShapeIntersection;
@@ -337,6 +339,14 @@ export interface RectCoords {
337
339
  width: number;
338
340
  height: number;
339
341
  }
342
+ /**
343
+ * Rectangle frame interface
344
+ */
345
+ export interface Frame extends IShape {
346
+ width: number;
347
+ height: number;
348
+ rotation: number;
349
+ }
340
350
  /**
341
351
  * Interface for an interactive canvas params
342
352
  */
@@ -351,6 +361,7 @@ export interface InteractiveCanvasParams {
351
361
  */
352
362
  export interface InteractiveCanvasItem {
353
363
  readonly position: IPoint;
364
+ readonly frame: Frame;
354
365
  readonly shapes: ReadonlyArray<IShape>;
355
366
  readonly isValid: boolean;
356
367
  readonly validPosition: IPoint;
@@ -359,7 +370,7 @@ export interface InteractiveCanvasItem {
359
370
  readonly active: boolean;
360
371
  readonly canvas: InteractiveCanvas;
361
372
  readonly index: number;
362
- draw(ctx: CanvasRenderingContext2D): MaybePromise<void>;
373
+ draw(ctx: CanvasRenderingContext2D, shape: IShape): MaybePromise<void>;
363
374
  }
364
375
  export type InteractiveCanvasItems = ReadonlyArray<InteractiveCanvasItem>;
365
376
  /**
@@ -2,10 +2,9 @@ import { IShape } from "../../common-types";
2
2
  import { InteractiveItemComponent } from "./interactive-item.component";
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class InteractiveCircleComponent extends InteractiveItemComponent {
5
- radius: number;
5
+ readonly radius: import("@angular/core").InputSignal<number>;
6
6
  constructor();
7
- draw(ctx: CanvasRenderingContext2D): void;
8
7
  protected calcShape(x: number, y: number): IShape;
9
8
  static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveCircleComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveCircleComponent, "interactive-circle", never, { "radius": { "alias": "radius"; "required": false; }; }, {}, never, never, false, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveCircleComponent, "interactive-circle", never, { "radius": { "alias": "radius"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
11
10
  }
@@ -1,11 +1,13 @@
1
1
  import { OnChanges } from "@angular/core";
2
- import { CanvasItemDirection, InteractiveCanvas, InteractiveCanvasItem, IPoint, IShape } from "../../common-types";
3
- import { Point } from "../../utils/geometry";
2
+ import { CanvasItemDirection, InteractiveCanvas, InteractiveCanvasItem, IPoint, IShape, Frame } from "../../common-types";
3
+ import { Point, Rect } from "../../utils/geometry";
4
4
  import { MaybePromise } from "../../helper-types";
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class InteractiveItemComponent implements OnChanges, InteractiveCanvasItem {
7
7
  protected pos: Point;
8
+ protected mFrame: Rect;
8
9
  protected mShapes: IShape[];
10
+ get frame(): Frame;
9
11
  get shapes(): ReadonlyArray<IShape>;
10
12
  get x(): number;
11
13
  set x(value: number);
@@ -28,7 +30,7 @@ export declare class InteractiveItemComponent implements OnChanges, InteractiveC
28
30
  protected valid: boolean;
29
31
  protected validPos: Point;
30
32
  constructor();
31
- draw(ctx: CanvasRenderingContext2D): MaybePromise<void>;
33
+ draw(ctx: CanvasRenderingContext2D, shape: IShape): MaybePromise<void>;
32
34
  ngOnChanges(): void;
33
35
  calcShapes(): void;
34
36
  hit(point: Point): boolean;
@@ -2,12 +2,11 @@ import { IShape } from "../../common-types";
2
2
  import { InteractiveItemComponent } from "./interactive-item.component";
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class InteractiveRectComponent extends InteractiveItemComponent {
5
- width: number;
6
- height: number;
7
- rotation: number;
5
+ readonly width: import("@angular/core").InputSignal<number>;
6
+ readonly height: import("@angular/core").InputSignal<number>;
7
+ readonly rotation: import("@angular/core").InputSignal<number>;
8
8
  constructor();
9
- draw(ctx: CanvasRenderingContext2D): void;
10
9
  protected calcShape(x: number, y: number): IShape;
11
10
  static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveRectComponent, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveRectComponent, "interactive-rect", never, { "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "rotation": { "alias": "rotation"; "required": false; }; }, {}, never, never, false, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveRectComponent, "interactive-rect", never, { "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "rotation": { "alias": "rotation"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
13
12
  }
@@ -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 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 | {
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 | {
68
68
  provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
69
69
  useClass: typeof DragDropEventPlugin;
70
70
  multi: boolean;
@@ -1,7 +1,4 @@
1
1
  import { CanvasColor } from "../common-types";
2
- export declare function drawRect(ctx: CanvasRenderingContext2D, w: number, h: number): void;
3
- export declare function drawOval(ctx: CanvasRenderingContext2D, w: number, h: number): void;
4
- export declare function drawPoint(ctx: CanvasRenderingContext2D): void;
5
2
  export declare class CanvasUtils {
6
3
  static manipulatePixels(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, colorTransformer: (color: CanvasColor, greyscale?: number) => CanvasColor): void;
7
4
  static thresholding(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, threshold: number, colorTransformer: (color: CanvasColor, limit: boolean, greyscale?: number) => CanvasColor): void;
@@ -5,6 +5,7 @@ declare abstract class Shape implements IShape {
5
5
  get y(): number;
6
6
  protected pt: IPoint;
7
7
  protected constructor(x: number, y: number);
8
+ abstract draw(ctx: CanvasRenderingContext2D, ratio?: number): void;
8
9
  abstract support(dir: IPoint): IPoint;
9
10
  abstract move(pos: IPoint): IShape;
10
11
  intersection(shape: IShape): ShapeIntersection;
@@ -17,6 +18,7 @@ export declare class Point extends Shape {
17
18
  get length(): number;
18
19
  get perpendicular(): Point;
19
20
  constructor(xOrP: number | IPoint, y?: number);
21
+ draw(ctx: CanvasRenderingContext2D): void;
20
22
  support(): IPoint;
21
23
  move(pos: IPoint): IShape;
22
24
  add(p: IPoint): Point;
@@ -36,6 +38,7 @@ export declare class Rect extends Shape {
36
38
  readonly height: number;
37
39
  readonly rotation: number;
38
40
  constructor(x: number, y: number, width: number, height: number, rotation?: number);
41
+ draw(ctx: CanvasRenderingContext2D, ratio: number): void;
39
42
  support(dir: IPoint): IPoint;
40
43
  move(pos: IPoint): Rect;
41
44
  }
@@ -44,6 +47,7 @@ export declare class Oval extends Shape {
44
47
  readonly height: number;
45
48
  readonly rotation: number;
46
49
  constructor(x: number, y: number, width: number, height: number, rotation?: number);
50
+ draw(ctx: CanvasRenderingContext2D, ratio: number): void;
47
51
  support(dir: IPoint): IPoint;
48
52
  move(pos: IPoint): Oval;
49
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-utils",
3
- "version": "19.7.9",
3
+ "version": "19.7.11",
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,12 +1,12 @@
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, 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";
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, Frame, 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";
7
7
  export { AuthGuard } from "./ngx-utils/utils/auth.guard";
8
8
  export { createTypedProvider, cachedFactory } from "./ngx-utils/utils/cached-factory";
9
- export { drawRect, drawOval, CanvasUtils } from "./ngx-utils/utils/canvas";
9
+ export { CanvasUtils } from "./ngx-utils/utils/canvas";
10
10
  export { DateUtils } from "./ngx-utils/utils/date.utils";
11
11
  export { FileUtils } from "./ngx-utils/utils/file.utils";
12
12
  export { ForbiddenZone } from "./ngx-utils/utils/forbidden-zone";