@stemy/ngx-utils 19.8.6 → 19.8.7
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 +121 -88
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +2 -0
- package/ngx-utils/components/interactive-canvas/interactive-item.component.d.ts +11 -4
- package/ngx-utils/components/interactive-canvas/interactive-rect.component.d.ts +1 -2
- package/ngx-utils/utils/geometry/functions.d.ts +1 -0
- package/ngx-utils/utils/geometry/index.d.ts +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +2 -2
|
@@ -363,10 +363,12 @@ export interface InteractiveCanvasParams {
|
|
|
363
363
|
*/
|
|
364
364
|
export interface InteractiveCanvasItem {
|
|
365
365
|
readonly position: IPoint;
|
|
366
|
+
readonly rotation: number;
|
|
366
367
|
readonly frame: Frame;
|
|
367
368
|
readonly shapes: ReadonlyArray<IShape>;
|
|
368
369
|
readonly isValid: boolean;
|
|
369
370
|
readonly validPosition: IPoint;
|
|
371
|
+
readonly validRotation: number;
|
|
370
372
|
readonly hovered: boolean;
|
|
371
373
|
readonly selected: boolean;
|
|
372
374
|
readonly active: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { OnChanges } from "@angular/core";
|
|
2
2
|
import { CanvasItemDirection, Frame, InteractiveCanvas, InteractiveCanvasItem, InteractiveCanvasParams, IPoint, IShape } from "../../common-types";
|
|
3
|
-
import { Point, Rect } from "../../utils/geometry";
|
|
4
3
|
import { MaybePromise } from "../../helper-types";
|
|
4
|
+
import { Point, Rect } from "../../utils/geometry";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class InteractiveItemComponent implements OnChanges, InteractiveCanvasItem {
|
|
7
7
|
protected pos: Point;
|
|
8
|
+
protected rot: number;
|
|
8
9
|
protected mFrame: Rect;
|
|
9
10
|
protected mShapes: IShape[];
|
|
10
11
|
protected mDistances: Map<InteractiveCanvasItem, number>;
|
|
@@ -16,9 +17,13 @@ export declare class InteractiveItemComponent implements OnChanges, InteractiveC
|
|
|
16
17
|
set y(value: number);
|
|
17
18
|
get position(): IPoint;
|
|
18
19
|
set position(value: IPoint);
|
|
20
|
+
get rotation(): number;
|
|
21
|
+
set rotation(value: number);
|
|
19
22
|
get isValid(): boolean;
|
|
20
23
|
get validPosition(): IPoint;
|
|
21
24
|
set validPosition(value: IPoint);
|
|
25
|
+
get validRotation(): number;
|
|
26
|
+
set validRotation(value: number);
|
|
22
27
|
get hovered(): boolean;
|
|
23
28
|
set hovered(value: boolean);
|
|
24
29
|
get selected(): boolean;
|
|
@@ -29,18 +34,20 @@ export declare class InteractiveItemComponent implements OnChanges, InteractiveC
|
|
|
29
34
|
canvas: InteractiveCanvas;
|
|
30
35
|
index: number;
|
|
31
36
|
canvasParams: InteractiveCanvasParams;
|
|
32
|
-
protected valid: boolean;
|
|
33
37
|
protected validPos: Point;
|
|
38
|
+
protected validRot: number;
|
|
34
39
|
constructor();
|
|
35
40
|
draw(ctx: CanvasRenderingContext2D, shape: IShape): MaybePromise<void>;
|
|
36
41
|
ngOnChanges(): void;
|
|
37
42
|
calcShapes(): void;
|
|
38
43
|
hit(point: Point): boolean;
|
|
39
|
-
moveTo(x: number, y: number): void;
|
|
40
44
|
moveBy(dx: number, dy: number): void;
|
|
41
45
|
moveX(x: number): void;
|
|
42
46
|
moveY(y: number): void;
|
|
47
|
+
moveTo(x: number, y: number): void;
|
|
43
48
|
moveEnd(): void;
|
|
49
|
+
rotateTo(value: number): void;
|
|
50
|
+
rotateEnd(): void;
|
|
44
51
|
protected restrictPosition(x: number, y: number): IPoint;
|
|
45
52
|
protected checkIsValid(): boolean;
|
|
46
53
|
protected isValidByParams(): boolean;
|
|
@@ -49,5 +56,5 @@ export declare class InteractiveItemComponent implements OnChanges, InteractiveC
|
|
|
49
56
|
protected getMinDistance(other: InteractiveCanvasItem): number;
|
|
50
57
|
protected calcShape(x: number, y: number): IShape;
|
|
51
58
|
static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveItemComponent, never>;
|
|
52
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveItemComponent, "__interactive-item__", never, { "x": { "alias": "x"; "required": false; }; "y": { "alias": "y"; "required": false; }; "position": { "alias": "position"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, false, never>;
|
|
59
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveItemComponent, "__interactive-item__", never, { "x": { "alias": "x"; "required": false; }; "y": { "alias": "y"; "required": false; }; "position": { "alias": "position"; "required": false; }; "rotation": { "alias": "rotation"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, false, never>;
|
|
53
60
|
}
|
|
@@ -4,9 +4,8 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class InteractiveRectComponent extends InteractiveItemComponent {
|
|
5
5
|
readonly width: import("@angular/core").InputSignal<number>;
|
|
6
6
|
readonly height: import("@angular/core").InputSignal<number>;
|
|
7
|
-
readonly rotation: import("@angular/core").InputSignal<number>;
|
|
8
7
|
constructor();
|
|
9
8
|
protected calcShape(x: number, y: number): IShape;
|
|
10
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveRectComponent, never>;
|
|
11
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveRectComponent, "interactive-rect", never, { "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; };
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveRectComponent, "interactive-rect", never, { "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
|
|
12
11
|
}
|
|
@@ -14,6 +14,7 @@ export declare function lengthOfPt(p: IPoint): number;
|
|
|
14
14
|
export declare function multiplyPts(a: IPoint, b: IPoint | number): IPoint;
|
|
15
15
|
export declare function dividePts(a: IPoint, b: IPoint | number): IPoint;
|
|
16
16
|
export declare function subPts(a: IPoint, b: IPoint): IPoint;
|
|
17
|
+
export declare function eqPts(a: IPoint, b: IPoint): boolean;
|
|
17
18
|
export declare function rotateDeg(p: IPoint, ang: number): IPoint;
|
|
18
19
|
export declare function rotateRad(p: IPoint, ang: number): IPoint;
|
|
19
20
|
export declare function toDegrees(rad: number): number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { gjkDistance, gjkIntersection } from "./gjk";
|
|
2
|
-
export { dotProduct, tripleProduct, isPoint, ensurePoint, perpendicular, negatePt, normalizePt, addPts, distanceSq, distance, lerpPts, lengthOfPt, multiplyPts, dividePts, subPts, rotateDeg, rotateRad, toDegrees, toRadians } from "./functions";
|
|
2
|
+
export { dotProduct, tripleProduct, isPoint, ensurePoint, perpendicular, negatePt, normalizePt, addPts, distanceSq, distance, lerpPts, lengthOfPt, multiplyPts, dividePts, subPts, eqPts, rotateDeg, rotateRad, toDegrees, toRadians } from "./functions";
|
|
3
3
|
export { Circle, Point, Rect, Oval, ShapeGroup } from "./shapes";
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -15,12 +15,12 @@ export { GenericValue } from "./ngx-utils/utils/generic-value";
|
|
|
15
15
|
export { FileSystemEntryOpenResult, FileSystemEntryOpenCb, FileSystemEntry } from "./ngx-utils/utils/file-system";
|
|
16
16
|
export { ExclusionsRenderer } from "./ngx-utils/utils/canvas-renderers/exclusions-renderer";
|
|
17
17
|
export { RulerCanvasRenderer } from "./ngx-utils/utils/canvas-renderers/ruler-canvas.renderer";
|
|
18
|
-
export { dotProduct, tripleProduct, isPoint, ensurePoint, perpendicular, negatePt, normalizePt, addPts, distanceSq, distance, lerpPts, lengthOfPt, multiplyPts, dividePts, subPts, rotateDeg, rotateRad, toDegrees, toRadians, gjkDistance, gjkIntersection, Point, Rect, Oval, Circle, ShapeGroup } from "./ngx-utils/utils/geometry";
|
|
18
|
+
export { dotProduct, tripleProduct, isPoint, ensurePoint, perpendicular, negatePt, normalizePt, addPts, distanceSq, distance, lerpPts, lengthOfPt, multiplyPts, dividePts, subPts, eqPts, rotateDeg, rotateRad, toDegrees, toRadians, gjkDistance, gjkIntersection, Point, Rect, Oval, Circle, ShapeGroup } from "./ngx-utils/utils/geometry";
|
|
19
19
|
export { Initializer } from "./ngx-utils/utils/initializer";
|
|
20
20
|
export { stringify } from "./ngx-utils/utils/json.utils";
|
|
21
21
|
export { ReflectUtils } from "./ngx-utils/utils/reflect.utils";
|
|
22
22
|
export { LoaderUtils } from "./ngx-utils/utils/loader.utils";
|
|
23
|
-
export { EPSILON, normalizeRange, clamp, overflow, MathUtils } from "./ngx-utils/utils/math.utils";
|
|
23
|
+
export { EPSILON, normalizeRange, clamp, overflow, isEqual, isZero, MathUtils } from "./ngx-utils/utils/math.utils";
|
|
24
24
|
export { isBrowser, getRoot, switchClass, getCssVariables, checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents, provideOptions, provideWithOptions, injectOptions } from "./ngx-utils/utils/misc";
|
|
25
25
|
export { ObjectUtils } from "./ngx-utils/utils/object.utils";
|
|
26
26
|
export { ObservableUtils, ISubscriberInfo } from "./ngx-utils/utils/observable.utils";
|