@stemy/ngx-utils 19.7.6 → 19.7.8
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 +171 -158
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +12 -8
- package/ngx-utils/components/interactive-canvas/interactive-canvas.component.d.ts +47 -32
- package/ngx-utils/components/interactive-canvas/interactive-item.component.d.ts +5 -3
- package/ngx-utils/ngx-utils.imports.d.ts +2 -3
- package/ngx-utils/tokens.d.ts +1 -1
- package/ngx-utils/utils/misc.d.ts +4 -2
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
|
@@ -6,19 +6,24 @@ import { DurationLikeObject } from "luxon";
|
|
|
6
6
|
import { MaybePromise, StringKeys } from "./helper-types";
|
|
7
7
|
export type DurationUnit = StringKeys<DurationLikeObject>;
|
|
8
8
|
export interface TypedFactoryProvider<T> {
|
|
9
|
+
provide?: any;
|
|
9
10
|
useFactory: (...args: any[]) => T;
|
|
10
11
|
deps: any[];
|
|
11
12
|
}
|
|
12
13
|
export interface TypedValueProvider<T> {
|
|
14
|
+
provide?: any;
|
|
13
15
|
useValue: T;
|
|
14
16
|
}
|
|
15
17
|
export interface TypedExistingProvider<T> {
|
|
18
|
+
provide?: any;
|
|
16
19
|
useExisting: Type<T>;
|
|
17
20
|
}
|
|
18
21
|
export interface TypedClassProvider<T> {
|
|
22
|
+
provide?: any;
|
|
19
23
|
useClass: Type<T>;
|
|
20
24
|
}
|
|
21
25
|
export interface TypedTokenProvider<T> {
|
|
26
|
+
provide?: any;
|
|
22
27
|
useToken: InjectionToken<T>;
|
|
23
28
|
}
|
|
24
29
|
export type TypedProvider<T> = TypedFactoryProvider<T> | TypedValueProvider<T> | TypedExistingProvider<T> | TypedClassProvider<T> | TypedTokenProvider<T> | Type<T>;
|
|
@@ -346,11 +351,13 @@ export interface InteractiveCanvasParams {
|
|
|
346
351
|
export interface InteractiveCanvasItem {
|
|
347
352
|
readonly position: IPoint;
|
|
348
353
|
readonly shapes: ReadonlyArray<IShape>;
|
|
349
|
-
readonly canvas: InteractiveCanvas;
|
|
350
|
-
readonly index: number;
|
|
351
|
-
readonly active: boolean;
|
|
352
354
|
readonly isValid: boolean;
|
|
353
355
|
readonly validPosition: IPoint;
|
|
356
|
+
readonly hovered: boolean;
|
|
357
|
+
readonly selected: boolean;
|
|
358
|
+
readonly active: boolean;
|
|
359
|
+
readonly canvas: InteractiveCanvas;
|
|
360
|
+
readonly index: number;
|
|
354
361
|
draw(ctx: CanvasRenderingContext2D): MaybePromise<void>;
|
|
355
362
|
}
|
|
356
363
|
export type InteractiveCanvasItems = ReadonlyArray<InteractiveCanvasItem>;
|
|
@@ -359,16 +366,13 @@ export type InteractiveCanvasItems = ReadonlyArray<InteractiveCanvasItem>;
|
|
|
359
366
|
* Some properties are optional for compatibility with other kind of renderer functions
|
|
360
367
|
*/
|
|
361
368
|
export interface InteractiveCanvas {
|
|
362
|
-
readonly
|
|
363
|
-
readonly resizeMode?: CanvasResizeMode;
|
|
364
|
-
readonly params?: InteractiveCanvasParams;
|
|
369
|
+
readonly isInfinite?: boolean;
|
|
365
370
|
readonly realWidth?: number;
|
|
366
371
|
readonly realHeight?: number;
|
|
367
|
-
readonly $items?: Observable<InteractiveCanvasItems>;
|
|
368
372
|
readonly items?: InteractiveCanvasItems;
|
|
369
373
|
readonly canvas: HTMLCanvasElement;
|
|
370
374
|
readonly lockedItem?: InteractiveCanvasItem;
|
|
371
|
-
|
|
375
|
+
selectedItem?: InteractiveCanvasItem;
|
|
372
376
|
hoveredItem?: InteractiveCanvasItem;
|
|
373
377
|
readonly xRange?: RangeCoords;
|
|
374
378
|
readonly yRange?: RangeCoords;
|
|
@@ -1,45 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BehaviorSubject, Subscription } from "rxjs";
|
|
1
|
+
import { ElementRef, OnDestroy, OnInit, Renderer2 } from "@angular/core";
|
|
3
2
|
import { CanvasPaintFunc, CanvasResizeMode, InteractiveCanvas, InteractiveCanvasItem, InteractiveCanvasParams, InteractiveCanvasPointer, InteractiveCanvasRenderer, InteractivePanEvent, IPoint, RangeCoords } from "../../common-types";
|
|
4
3
|
import { Point, Rect } from "../../utils/geometry";
|
|
5
|
-
import { InteractiveItemComponent } from "./interactive-item.component";
|
|
6
4
|
import { UniversalService } from "../../services/universal.service";
|
|
5
|
+
import { InteractiveItemComponent } from "./interactive-item.component";
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class InteractiveCanvasComponent implements InteractiveCanvas, OnInit, OnDestroy
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
export declare class InteractiveCanvasComponent implements InteractiveCanvas, OnInit, OnDestroy {
|
|
8
|
+
/**
|
|
9
|
+
* Injectable options
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
protected readonly options: {
|
|
13
|
+
infinite: boolean;
|
|
14
|
+
resizeMode: CanvasResizeMode;
|
|
15
|
+
panOffset: number;
|
|
16
|
+
};
|
|
17
|
+
protected readonly renderer: Renderer2;
|
|
18
|
+
protected readonly universal: UniversalService;
|
|
19
|
+
/**
|
|
20
|
+
* Is the canvas infinitely scrollable?
|
|
21
|
+
*/
|
|
22
|
+
readonly infinite: import("@angular/core").InputSignal<boolean>;
|
|
23
|
+
readonly resizeMode: import("@angular/core").InputSignal<CanvasResizeMode>;
|
|
24
|
+
readonly horizontal: import("@angular/core").InputSignal<boolean>;
|
|
14
25
|
/**
|
|
15
26
|
* Real life-size width of the canvas
|
|
16
27
|
*/
|
|
17
|
-
|
|
28
|
+
readonly width: import("@angular/core").InputSignal<number>;
|
|
18
29
|
/**
|
|
19
30
|
* Real life-size height of the canvas
|
|
20
31
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
readonly height: import("@angular/core").InputSignal<number>;
|
|
33
|
+
/**
|
|
34
|
+
* Canvas params
|
|
35
|
+
*/
|
|
36
|
+
readonly params: import("@angular/core").InputSignalWithTransform<InteractiveCanvasParams, InteractiveCanvasParams>;
|
|
37
|
+
/**
|
|
38
|
+
* Model signal for selected index
|
|
39
|
+
*/
|
|
40
|
+
readonly selectedIndex: import("@angular/core").ModelSignal<number>;
|
|
25
41
|
/**
|
|
26
42
|
* Relative offset of the panning. It is based on the rendered canvas height
|
|
27
43
|
*/
|
|
28
|
-
panOffset: number
|
|
29
|
-
renderCtx: Record<string, any
|
|
30
|
-
beforeItems:
|
|
31
|
-
afterItems:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
readonly panOffset: import("@angular/core").InputSignal<number>;
|
|
45
|
+
readonly renderCtx: import("@angular/core").InputSignal<Record<string, any>>;
|
|
46
|
+
readonly beforeItems: import("@angular/core").InputSignal<readonly InteractiveCanvasRenderer[]>;
|
|
47
|
+
readonly afterItems: import("@angular/core").InputSignal<readonly InteractiveCanvasRenderer[]>;
|
|
48
|
+
readonly onRotate: import("@angular/core").OutputEmitterRef<number>;
|
|
49
|
+
readonly onItemPan: import("@angular/core").OutputEmitterRef<InteractivePanEvent>;
|
|
50
|
+
readonly onItemPanned: import("@angular/core").OutputEmitterRef<InteractivePanEvent>;
|
|
51
|
+
readonly onPan: import("@angular/core").OutputEmitterRef<InteractivePanEvent>;
|
|
52
|
+
readonly onPanned: import("@angular/core").OutputEmitterRef<InteractivePanEvent>;
|
|
53
|
+
readonly itemList: import("@angular/core").Signal<readonly InteractiveItemComponent[]>;
|
|
54
|
+
get isInfinite(): boolean;
|
|
55
|
+
get realWidth(): number;
|
|
56
|
+
get realHeight(): number;
|
|
39
57
|
get items(): ReadonlyArray<InteractiveItemComponent>;
|
|
40
58
|
get canvas(): HTMLCanvasElement;
|
|
41
59
|
get lockedItem(): InteractiveItemComponent;
|
|
42
60
|
get selectedItem(): InteractiveItemComponent;
|
|
61
|
+
set selectedItem(item: InteractiveItemComponent);
|
|
43
62
|
get hoveredItem(): InteractiveItemComponent;
|
|
44
63
|
set hoveredItem(item: InteractiveItemComponent);
|
|
45
64
|
xRange: RangeCoords;
|
|
@@ -58,19 +77,16 @@ export declare class InteractiveCanvasComponent implements InteractiveCanvas, On
|
|
|
58
77
|
protected tempCanvas: HTMLCanvasElement;
|
|
59
78
|
protected shouldDraw: boolean;
|
|
60
79
|
protected hoveredIndex: number;
|
|
61
|
-
protected subscription: Subscription;
|
|
62
80
|
protected containerElem: ElementRef<HTMLDivElement>;
|
|
63
81
|
protected canvasElem: ElementRef<HTMLCanvasElement>;
|
|
64
|
-
protected itemList: QueryList<InteractiveItemComponent>;
|
|
65
82
|
protected touched: boolean;
|
|
66
83
|
protected panStartRotation: number;
|
|
67
84
|
protected panStartPos: IPoint;
|
|
68
85
|
protected lockedIndex: number;
|
|
69
|
-
|
|
86
|
+
protected oldLength: number;
|
|
87
|
+
constructor();
|
|
70
88
|
ngOnInit(): void;
|
|
71
89
|
ngOnDestroy(): void;
|
|
72
|
-
ngOnChanges(): void;
|
|
73
|
-
ngAfterViewInit(): void;
|
|
74
90
|
tempPaint(cb: CanvasPaintFunc): Promise<void>;
|
|
75
91
|
resize(): void;
|
|
76
92
|
onTouchStart($event: TouchEvent): void;
|
|
@@ -83,7 +99,6 @@ export declare class InteractiveCanvasComponent implements InteractiveCanvas, On
|
|
|
83
99
|
onPanMove($event: any): void;
|
|
84
100
|
onPanEnd(): void;
|
|
85
101
|
protected fixRotation(): void;
|
|
86
|
-
protected fixItems(): void;
|
|
87
102
|
protected selectItem(pointer: InteractiveCanvasPointer): void;
|
|
88
103
|
protected toCanvasPoint(pointer: InteractiveCanvasPointer): Point;
|
|
89
104
|
protected getIndexUnderPointer(pointer: InteractiveCanvasPointer): number;
|
|
@@ -94,5 +109,5 @@ export declare class InteractiveCanvasComponent implements InteractiveCanvas, On
|
|
|
94
109
|
protected drawItem(ctx: CanvasRenderingContext2D, item: InteractiveCanvasItem): Promise<void>;
|
|
95
110
|
protected draw(): Promise<void>;
|
|
96
111
|
static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveCanvasComponent, never>;
|
|
97
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveCanvasComponent, "interactive-canvas", never, { "infinite": { "alias": "infinite"; "required": false; }; "resizeMode": { "alias": "resizeMode"; "required": false; }; "
|
|
112
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveCanvasComponent, "interactive-canvas", never, { "infinite": { "alias": "infinite"; "required": false; "isSignal": true; }; "resizeMode": { "alias": "resizeMode"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "params": { "alias": "params"; "required": false; "isSignal": true; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; "isSignal": true; }; "panOffset": { "alias": "panOffset"; "required": false; "isSignal": true; }; "renderCtx": { "alias": "renderCtx"; "required": false; "isSignal": true; }; "beforeItems": { "alias": "beforeItems"; "required": false; "isSignal": true; }; "afterItems": { "alias": "afterItems"; "required": false; "isSignal": true; }; }, { "selectedIndex": "selectedIndexChange"; "onRotate": "onRotate"; "onItemPan": "onItemPan"; "onItemPanned": "onItemPanned"; "onPan": "onPan"; "onPanned": "onPanned"; }, ["itemList"], never, false, never>;
|
|
98
113
|
}
|
|
@@ -7,8 +7,6 @@ export declare class InteractiveItemComponent implements OnChanges, InteractiveC
|
|
|
7
7
|
protected pos: Point;
|
|
8
8
|
protected mShapes: IShape[];
|
|
9
9
|
get shapes(): ReadonlyArray<IShape>;
|
|
10
|
-
get hovered(): boolean;
|
|
11
|
-
set hovered(value: boolean);
|
|
12
10
|
get x(): number;
|
|
13
11
|
set x(value: number);
|
|
14
12
|
get y(): number;
|
|
@@ -18,11 +16,15 @@ export declare class InteractiveItemComponent implements OnChanges, InteractiveC
|
|
|
18
16
|
get isValid(): boolean;
|
|
19
17
|
get validPosition(): IPoint;
|
|
20
18
|
set validPosition(value: IPoint);
|
|
19
|
+
get hovered(): boolean;
|
|
20
|
+
set hovered(value: boolean);
|
|
21
|
+
get selected(): boolean;
|
|
22
|
+
set selected(value: boolean);
|
|
21
23
|
direction: CanvasItemDirection;
|
|
22
24
|
disabled: boolean;
|
|
25
|
+
active: boolean;
|
|
23
26
|
canvas: InteractiveCanvas;
|
|
24
27
|
index: number;
|
|
25
|
-
active: boolean;
|
|
26
28
|
protected valid: boolean;
|
|
27
29
|
protected validPos: Point;
|
|
28
30
|
constructor();
|
|
@@ -58,14 +58,13 @@ import { ChipsComponent } from "./components/chips/chips.component";
|
|
|
58
58
|
import { CloseBtnComponent } from "./components/close-btn/close-btn.component";
|
|
59
59
|
import { DropListComponent } from "./components/drop-list/drop-list.component";
|
|
60
60
|
import { DynamicTableComponent } from "./components/dynamic-table/dynamic-table.component";
|
|
61
|
-
import { InteractiveCanvasComponent } from "./components/interactive-canvas/interactive-canvas.component";
|
|
62
61
|
import { PaginationMenuComponent } from "./components/pagination-menu/pagination-menu.component";
|
|
63
62
|
import { UnorderedListComponent } from "./components/unordered-list/unordered-list.component";
|
|
64
63
|
import { UploadComponent } from "./components/upload/upload.component";
|
|
65
64
|
export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
|
|
66
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)[];
|
|
67
|
-
export declare const components: (typeof ChipsComponent | typeof CloseBtnComponent | typeof DropListComponent | typeof DynamicTableComponent | typeof
|
|
68
|
-
export declare const providers: (typeof
|
|
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 | {
|
|
69
68
|
provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
|
|
70
69
|
useClass: typeof DragDropEventPlugin;
|
|
71
70
|
multi: boolean;
|
package/ngx-utils/tokens.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ButtonProps, DynamicEntryComponents, DynamicModuleInfo, ErrorHandlerCal
|
|
|
4
4
|
export declare const ICON_TYPE: InjectionToken<Type<IconProps>>;
|
|
5
5
|
export declare const ICON_MAP: InjectionToken<IconMap>;
|
|
6
6
|
export declare const BUTTON_TYPE: InjectionToken<Type<ButtonProps>>;
|
|
7
|
-
export declare const OPTIONS_TOKEN: InjectionToken<
|
|
7
|
+
export declare const OPTIONS_TOKEN: InjectionToken<Record<string, any>>;
|
|
8
8
|
export declare const ICON_SERVICE: InjectionToken<IIconService>;
|
|
9
9
|
export declare const LANGUAGE_SERVICE: InjectionToken<ILanguageService>;
|
|
10
10
|
export declare const AUTH_SERVICE: InjectionToken<IAuthService>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type, ValueProvider, ɵComponentDef as ComponentDef } from "@angular/core";
|
|
2
|
-
import { CssSelector, CssSelectorList, TypedFactoryProvider } from "../common-types";
|
|
2
|
+
import { CssSelector, CssSelectorList, TypedFactoryProvider, TypedValueProvider } from "../common-types";
|
|
3
3
|
export declare function isBrowser(): boolean;
|
|
4
4
|
/**
|
|
5
5
|
* Returns an elements root
|
|
@@ -20,4 +20,6 @@ export declare function getComponentDef<T>(type: Type<T>): ComponentDef<T>;
|
|
|
20
20
|
export declare function parseSelector(selector: string | CssSelector): CssSelector;
|
|
21
21
|
export declare function selectorMatchesList(list: CssSelectorList, selector: CssSelector): boolean;
|
|
22
22
|
export declare function provideEntryComponents(components: Type<any>[], moduleId?: string): ValueProvider;
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function provideOptions<O extends Record<string, any>>(options: O): Required<TypedValueProvider<O>>;
|
|
24
|
+
export declare function provideWithOptions<O extends Record<string, any>, T = any>(type: Type<T>, options: O): TypedFactoryProvider<T>;
|
|
25
|
+
export declare function injectOptions<O extends Record<string, any>>(defaults: O): O;
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export { JSONfn } from "./ngx-utils/utils/jsonfn";
|
|
|
18
18
|
export { ReflectUtils } from "./ngx-utils/utils/reflect.utils";
|
|
19
19
|
export { LoaderUtils } from "./ngx-utils/utils/loader.utils";
|
|
20
20
|
export { EPSILON, normalizeRange, clamp, overflow, MathUtils } from "./ngx-utils/utils/math.utils";
|
|
21
|
-
export { isBrowser, getRoot, hashCode, switchClass, getCssVariables, checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents, provideWithOptions } from "./ngx-utils/utils/misc";
|
|
21
|
+
export { isBrowser, getRoot, hashCode, switchClass, getCssVariables, checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents, provideOptions, provideWithOptions, injectOptions } from "./ngx-utils/utils/misc";
|
|
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";
|