@wcardinal/wcardinal-ui 0.193.0 → 0.194.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/dist/types/wcardinal/ui/shape/action/e-shape-action-runtime-misc-html-element-base.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/e-shape-capability.d.ts +69 -3
- package/dist/types/wcardinal/ui/shape/load/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/load/load-shape-clipper-ex.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/create-circle-uploaded.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-html-element.d.ts +5 -2
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-html-element.d.ts +5 -2
- package/dist/types/wcardinal/ui/util/index.d.ts +4 -0
- package/dist/types/wcardinal/ui/util/util-html-element-clipper-ex-impl.d.ts +15 -0
- package/dist/types/wcardinal/ui/util/util-html-element-clipper-ex-rects-impl.d.ts +15 -0
- package/dist/types/wcardinal/ui/util/util-html-element-clipper-ex-rects.d.ts +9 -0
- package/dist/types/wcardinal/ui/util/util-html-element-clipper-ex.d.ts +6 -0
- package/dist/types/wcardinal/ui/util/util-html-element.d.ts +16 -5
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-html-element-base.js +40 -3
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-html-element-base.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-input.js +3 -0
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-input.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-capability.js +73 -6
- package/dist/wcardinal/ui/shape/e-shape-capability.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/index.js +1 -0
- package/dist/wcardinal/ui/shape/load/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-circle.js +2 -2
- package/dist/wcardinal/ui/shape/load/load-shape-circle.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-clipper-ex.js +12 -0
- package/dist/wcardinal/ui/shape/load/load-shape-clipper-ex.js.map +1 -0
- package/dist/wcardinal/ui/shape/load/load-shape-group-shadowed.js +3 -0
- package/dist/wcardinal/ui/shape/load/load-shape-group-shadowed.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-group.js +3 -0
- package/dist/wcardinal/ui/shape/load/load-shape-group.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/create-circle-uploaded.js +1 -1
- package/dist/wcardinal/ui/shape/variant/create-circle-uploaded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/index.js +1 -0
- package/dist/wcardinal/ui/shape/variant/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-html-element.js +14 -3
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-html-element.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-html-element.js +14 -3
- package/dist/wcardinal/ui/theme/white/d-theme-white-html-element.js.map +1 -1
- package/dist/wcardinal/ui/util/index.js +4 -0
- package/dist/wcardinal/ui/util/index.js.map +1 -1
- package/dist/wcardinal/ui/util/util-html-element-clipper-ex-impl.js +520 -0
- package/dist/wcardinal/ui/util/util-html-element-clipper-ex-impl.js.map +1 -0
- package/dist/wcardinal/ui/util/util-html-element-clipper-ex-rects-impl.js +72 -0
- package/dist/wcardinal/ui/util/util-html-element-clipper-ex-rects-impl.js.map +1 -0
- package/dist/wcardinal/ui/util/util-html-element-clipper-ex-rects.js +6 -0
- package/dist/wcardinal/ui/util/util-html-element-clipper-ex-rects.js.map +1 -0
- package/dist/wcardinal/ui/util/util-html-element-clipper-ex.js +6 -0
- package/dist/wcardinal/ui/util/util-html-element-clipper-ex.js.map +1 -0
- package/dist/wcardinal/ui/util/util-html-element.js +67 -10
- package/dist/wcardinal/ui/util/util-html-element.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +15 -4
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +15 -4
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
- package/dist/wcardinal-ui.cjs.js +1071 -281
- package/dist/wcardinal-ui.js +1043 -275
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
package/dist/types/wcardinal/ui/shape/action/e-shape-action-runtime-misc-html-element-base.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { EShapeRuntime } from "../e-shape-runtime";
|
|
|
8
8
|
import { EShapeActionExpression } from "./e-shape-action-expression";
|
|
9
9
|
import { EShapeActionRuntime } from "./e-shape-action-runtime";
|
|
10
10
|
import { EShapeActionValueMisc } from "./e-shape-action-value-misc";
|
|
11
|
+
import { UtilHtmlElementClipperExRects } from "../../util/util-html-element-clipper-ex-rects";
|
|
11
12
|
export declare abstract class EShapeActionRuntimeMiscHtmlElementBase<ELEMENT extends HTMLElement = HTMLElement, UTIL extends UtilHtmlElement<ELEMENT> = UtilHtmlElement<ELEMENT>> extends EShapeActionRuntime {
|
|
12
13
|
protected static WORK?: Point;
|
|
13
14
|
protected readonly condition: EShapeActionExpression<string | null>;
|
|
@@ -24,6 +25,7 @@ export declare abstract class EShapeActionRuntimeMiscHtmlElementBase<ELEMENT ext
|
|
|
24
25
|
protected getElementRect(shape: EShape, runtime: EShapeRuntime, resolution: number, point: Point, result: Rectangle): Rectangle | null;
|
|
25
26
|
protected getElementMatrix(shape: EShape, runtime: EShapeRuntime): Matrix | null;
|
|
26
27
|
protected getClipperToRect(shape: EShape, runtime: EShapeRuntime, resolution: number, point: Point, result: Rectangle): Rectangle | null;
|
|
28
|
+
protected getClipperExRects(shape: EShape, result: UtilHtmlElementClipperExRects): void;
|
|
27
29
|
onRender(shape: EShape, runtime: EShapeRuntime, time: number, renderer: Renderer): void;
|
|
28
30
|
onFocus(shape: EShape, runtime: EShapeRuntime): void;
|
|
29
31
|
onBlur(shape: EShape, runtime: EShapeRuntime): void;
|
|
@@ -1,32 +1,98 @@
|
|
|
1
1
|
export declare const EShapeCapability: {
|
|
2
2
|
readonly NONE: 0;
|
|
3
|
+
/**
|
|
4
|
+
* Allows shape IDs to be modified.
|
|
5
|
+
*/
|
|
3
6
|
readonly ID: 1;
|
|
7
|
+
/**
|
|
8
|
+
* Allows shape positions to be modified.
|
|
9
|
+
*/
|
|
4
10
|
readonly POSITION: 2;
|
|
11
|
+
/**
|
|
12
|
+
* Allows shape widths to be modified.
|
|
13
|
+
*/
|
|
5
14
|
readonly WIDTH: 4;
|
|
15
|
+
/**
|
|
16
|
+
* Allows shape heights to be modified.
|
|
17
|
+
*/
|
|
6
18
|
readonly HEIGHT: 8;
|
|
19
|
+
/**
|
|
20
|
+
* Allows shape rotations to be modified.
|
|
21
|
+
*/
|
|
7
22
|
readonly ROTATION: 16;
|
|
23
|
+
/**
|
|
24
|
+
* Allows shape skews to be modified.
|
|
25
|
+
*/
|
|
8
26
|
readonly SKEW: 32;
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
|
|
27
|
+
/** @deprecated */
|
|
28
|
+
readonly ALIGN: 0;
|
|
29
|
+
/**
|
|
30
|
+
* Allows shapes to be replaced with other shapes.
|
|
31
|
+
*/
|
|
32
|
+
readonly REPLACING: 64;
|
|
33
|
+
/**
|
|
34
|
+
* Allows shapes to be grouped.
|
|
35
|
+
*/
|
|
36
|
+
readonly GROUPING: 128;
|
|
37
|
+
/**
|
|
38
|
+
* Allows grouped shapes to be ungrouped.
|
|
39
|
+
*/
|
|
40
|
+
readonly UNGROUPING: 256;
|
|
41
|
+
/**
|
|
42
|
+
* Allows shape fills to be modified.
|
|
43
|
+
*/
|
|
12
44
|
readonly FILL: 512;
|
|
45
|
+
/**
|
|
46
|
+
* Allows shape strokes to be modified.
|
|
47
|
+
*/
|
|
13
48
|
readonly STROKE: 1024;
|
|
49
|
+
/**
|
|
50
|
+
* Allows shape stroke sides to be modified.
|
|
51
|
+
*/
|
|
14
52
|
readonly STROKE_SIDE: 2048;
|
|
53
|
+
/**
|
|
54
|
+
* Allows shape border radiuses to be modified.
|
|
55
|
+
*/
|
|
15
56
|
readonly BORDER_RADIUS: 4096;
|
|
57
|
+
/**
|
|
58
|
+
* Allows shape texts to be modified.
|
|
59
|
+
*/
|
|
16
60
|
readonly TEXT: 8192;
|
|
61
|
+
/**
|
|
62
|
+
* Allows shape textures to be modified.
|
|
63
|
+
*/
|
|
17
64
|
readonly TEXTURE: 16384;
|
|
18
65
|
/** @deprecated in favor of {@link DATA} */
|
|
19
66
|
readonly TAG: 32768;
|
|
67
|
+
/**
|
|
68
|
+
* Allows shape data to be modified.
|
|
69
|
+
*/
|
|
20
70
|
readonly DATA: 32768;
|
|
71
|
+
/**
|
|
72
|
+
* Allows shape data mapping to be modified.
|
|
73
|
+
*/
|
|
21
74
|
readonly DATA_MAPPING: 1048576;
|
|
75
|
+
/**
|
|
76
|
+
* Allows shape actions to be modified.
|
|
77
|
+
*/
|
|
22
78
|
readonly ACTION: 65536;
|
|
79
|
+
/**
|
|
80
|
+
* Allows shape cursors to be modified.
|
|
81
|
+
*/
|
|
23
82
|
readonly CURSOR: 131072;
|
|
83
|
+
/**
|
|
84
|
+
* Allows shape orders in layer to be modified.
|
|
85
|
+
*/
|
|
24
86
|
readonly ORDER_IN_LAYER: 262144;
|
|
87
|
+
/**
|
|
88
|
+
* Allows shape children to be modified.
|
|
89
|
+
*/
|
|
25
90
|
readonly CHILDREN: 524288;
|
|
26
91
|
readonly COORDINATE: number;
|
|
27
92
|
readonly SHAPE: number;
|
|
28
93
|
readonly LAYER: 262144;
|
|
29
94
|
readonly PRIMITIVE: number;
|
|
95
|
+
readonly GROUP: number;
|
|
30
96
|
readonly EMBEDDED: number;
|
|
31
97
|
readonly CONNECTOR: number;
|
|
32
98
|
readonly ALL: number;
|
|
@@ -2,6 +2,7 @@ export * from "./load-shape-all";
|
|
|
2
2
|
export * from "./load-shape-bar";
|
|
3
3
|
export * from "./load-shape-button";
|
|
4
4
|
export * from "./load-shape-circle";
|
|
5
|
+
export * from "./load-shape-clipper-ex";
|
|
5
6
|
export * from "./load-shape-connector-line";
|
|
6
7
|
export * from "./load-shape-embedded";
|
|
7
8
|
export * from "./load-shape-group-shadowed";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { EShape } from "../e-shape";
|
|
2
2
|
import { EShapeBuffer } from "../e-shape-buffer";
|
|
3
3
|
import { EShapeUploaded } from "../e-shape-uploaded";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const createCircleUploaded: (buffer: EShapeBuffer, shape: EShape, voffset: number, ioffset: number, antialiasWeight: number) => EShapeUploaded | null;
|
|
@@ -88,6 +88,7 @@ export * from "./deserialize-line-of-triangle-roundeds";
|
|
|
88
88
|
export * from "./deserialize-line-of-triangles";
|
|
89
89
|
export * from "./deserialize-line";
|
|
90
90
|
export * from "./deserialize-null";
|
|
91
|
+
export * from "./deserialize-rectangle-pivoted";
|
|
91
92
|
export * from "./deserialize-rectangle-rounded";
|
|
92
93
|
export * from "./deserialize-rectangle";
|
|
93
94
|
export * from "./deserialize-triangle-rounded";
|
|
@@ -2,11 +2,12 @@ import { Matrix, Rectangle } from "pixi.js";
|
|
|
2
2
|
import { DBaseStateSet } from "../../d-base-state-set";
|
|
3
3
|
import { DThemeHtmlElement } from "../../d-html-element";
|
|
4
4
|
import { UtilHtmlElementCreator, UtilHtmlElementPadding } from "../../util/util-html-element";
|
|
5
|
+
import { UtilHtmlElementClipperEx } from "../../util/util-html-element-clipper-ex";
|
|
5
6
|
import { UtilHtmlElementWhen } from "../../util/util-html-element-when";
|
|
6
7
|
import { DThemeDarkImageBase } from "./d-theme-dark-image-base";
|
|
7
8
|
export declare class DThemeDarkHtmlElement<VALUE = unknown, ELEMENT extends HTMLElement = HTMLElement> extends DThemeDarkImageBase<VALUE> implements DThemeHtmlElement<VALUE, ELEMENT> {
|
|
8
9
|
getElementCreator(): UtilHtmlElementCreator<ELEMENT>;
|
|
9
|
-
setElementStyle(target: ELEMENT, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null): void;
|
|
10
|
+
setElementStyle(target: ELEMENT, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null, clipperEx: UtilHtmlElementClipperEx | null | undefined): void;
|
|
10
11
|
protected getElementStylePointerEvent(state: DBaseStateSet): string;
|
|
11
12
|
protected getElementStyleBackground(state: DBaseStateSet): string;
|
|
12
13
|
protected getElementStyleBorder(state: DBaseStateSet): string;
|
|
@@ -18,12 +19,14 @@ export declare class DThemeDarkHtmlElement<VALUE = unknown, ELEMENT extends HTML
|
|
|
18
19
|
protected getElementStylePosition(state: DBaseStateSet, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null): string;
|
|
19
20
|
protected getElementStyleText(state: DBaseStateSet): string;
|
|
20
21
|
protected getElementStyleMargin(state: DBaseStateSet): string;
|
|
22
|
+
protected getElementStyleClipPath(state: DBaseStateSet, clipperEx: UtilHtmlElementClipperEx | null | undefined): string;
|
|
21
23
|
getClipperCreator(): UtilHtmlElementCreator<HTMLDivElement>;
|
|
22
|
-
setClipperStyle(target: HTMLDivElement, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null): void;
|
|
24
|
+
setClipperStyle(target: HTMLDivElement, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null, clipperEx: UtilHtmlElementClipperEx | null | undefined): void;
|
|
23
25
|
protected getClipperStyleOverflow(rect: Rectangle | null): string;
|
|
24
26
|
protected getClipperStylePositionPosition(rect: Rectangle | null): string;
|
|
25
27
|
protected getClipperStylePositionSize(rect: Rectangle | null): string;
|
|
26
28
|
protected getClipperStylePosition(rect: Rectangle | null): string;
|
|
29
|
+
isClipperExEnabled(): boolean;
|
|
27
30
|
getBeforeCreator(): UtilHtmlElementCreator<HTMLDivElement>;
|
|
28
31
|
setBeforeStyle(target: HTMLDivElement): void;
|
|
29
32
|
getAfterCreator(): UtilHtmlElementCreator<HTMLDivElement>;
|
|
@@ -2,11 +2,12 @@ import { Matrix, Rectangle } from "pixi.js";
|
|
|
2
2
|
import { DBaseStateSet } from "../../d-base-state-set";
|
|
3
3
|
import { DThemeHtmlElement } from "../../d-html-element";
|
|
4
4
|
import { UtilHtmlElementCreator, UtilHtmlElementPadding } from "../../util/util-html-element";
|
|
5
|
+
import { UtilHtmlElementClipperEx } from "../../util/util-html-element-clipper-ex";
|
|
5
6
|
import { UtilHtmlElementWhen } from "../../util/util-html-element-when";
|
|
6
7
|
import { DThemeWhiteImageBase } from "./d-theme-white-image-base";
|
|
7
8
|
export declare class DThemeWhiteHtmlElement<VALUE = unknown, ELEMENT extends HTMLElement = HTMLElement> extends DThemeWhiteImageBase<VALUE> implements DThemeHtmlElement<VALUE, ELEMENT> {
|
|
8
9
|
getElementCreator(): UtilHtmlElementCreator<ELEMENT>;
|
|
9
|
-
setElementStyle(target: ELEMENT, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null): void;
|
|
10
|
+
setElementStyle(target: ELEMENT, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null, clipperEx: UtilHtmlElementClipperEx | null | undefined): void;
|
|
10
11
|
protected getElementStylePointerEvent(state: DBaseStateSet): string;
|
|
11
12
|
protected getElementStyleBackground(state: DBaseStateSet): string;
|
|
12
13
|
protected getElementStyleBorder(state: DBaseStateSet): string;
|
|
@@ -18,12 +19,14 @@ export declare class DThemeWhiteHtmlElement<VALUE = unknown, ELEMENT extends HTM
|
|
|
18
19
|
protected getElementStylePosition(state: DBaseStateSet, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null): string;
|
|
19
20
|
protected getElementStyleText(state: DBaseStateSet): string;
|
|
20
21
|
protected getElementStyleMargin(state: DBaseStateSet): string;
|
|
22
|
+
protected getElementStyleClipPath(state: DBaseStateSet, clipperEx: UtilHtmlElementClipperEx | null | undefined): string;
|
|
21
23
|
getClipperCreator(): UtilHtmlElementCreator<HTMLDivElement>;
|
|
22
|
-
setClipperStyle(target: HTMLDivElement, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null): void;
|
|
24
|
+
setClipperStyle(target: HTMLDivElement, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null, clipperEx: UtilHtmlElementClipperEx | null | undefined): void;
|
|
23
25
|
protected getClipperStyleOverflow(rect: Rectangle | null): string;
|
|
24
26
|
protected getClipperStylePositionPosition(rect: Rectangle | null): string;
|
|
25
27
|
protected getClipperStylePositionSize(rect: Rectangle | null): string;
|
|
26
28
|
protected getClipperStylePosition(rect: Rectangle | null): string;
|
|
29
|
+
isClipperExEnabled(): boolean;
|
|
27
30
|
getBeforeCreator(): UtilHtmlElementCreator<HTMLDivElement>;
|
|
28
31
|
setBeforeStyle(target: HTMLDivElement): void;
|
|
29
32
|
getAfterCreator(): UtilHtmlElementCreator<HTMLDivElement>;
|
|
@@ -55,6 +55,10 @@ export * from "./util-file-downloader";
|
|
|
55
55
|
export * from "./util-file-opener";
|
|
56
56
|
export * from "./util-font";
|
|
57
57
|
export * from "./util-hsv";
|
|
58
|
+
export * from "./util-html-element-clipper-ex-impl";
|
|
59
|
+
export * from "./util-html-element-clipper-ex-rects-impl";
|
|
60
|
+
export * from "./util-html-element-clipper-ex-rects";
|
|
61
|
+
export * from "./util-html-element-clipper-ex";
|
|
58
62
|
export * from "./util-html-element-when";
|
|
59
63
|
export * from "./util-html-element";
|
|
60
64
|
export * from "./util-input-input";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Matrix, Rectangle } from "pixi.js";
|
|
2
|
+
import { UtilHtmlElementClipperEx } from "./util-html-element-clipper-ex";
|
|
3
|
+
import { UtilHtmlElementClipperExRects } from "./util-html-element-clipper-ex-rects";
|
|
4
|
+
export declare class UtilHtmlElementClipperExImpl implements UtilHtmlElementClipperEx {
|
|
5
|
+
private static WORK_MATRIX?;
|
|
6
|
+
private static WORK_RECTS?;
|
|
7
|
+
private _id;
|
|
8
|
+
private _path;
|
|
9
|
+
private _pathD;
|
|
10
|
+
constructor(container: HTMLElement);
|
|
11
|
+
get id(): string;
|
|
12
|
+
update(elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperExRects: UtilHtmlElementClipperExRects): void;
|
|
13
|
+
protected toD(elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperExRects: UtilHtmlElementClipperExRects): string;
|
|
14
|
+
protected toRects(clipperExRects: UtilHtmlElementClipperExRects, result: number[]): number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UtilHtmlElementClipperExRects } from "./util-html-element-clipper-ex-rects";
|
|
2
|
+
export declare class UtilHtmlElementClipperExRectsImpl implements UtilHtmlElementClipperExRects {
|
|
3
|
+
private _data;
|
|
4
|
+
private _size;
|
|
5
|
+
private _index;
|
|
6
|
+
private _isDirty;
|
|
7
|
+
constructor();
|
|
8
|
+
get data(): number[];
|
|
9
|
+
get size(): number;
|
|
10
|
+
isDirty(): boolean;
|
|
11
|
+
toClean(): void;
|
|
12
|
+
begin(): this;
|
|
13
|
+
end(): this;
|
|
14
|
+
add(x0: number, y0: number, x1: number, y1: number): this;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Matrix, Rectangle } from "pixi.js";
|
|
2
|
+
import { UtilHtmlElementClipperExRects } from "./util-html-element-clipper-ex-rects";
|
|
3
|
+
export interface UtilHtmlElementClipperEx {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
update(elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperExRects: UtilHtmlElementClipperExRects): void;
|
|
6
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { interaction, Matrix, Point, Rectangle, Renderer } from "pixi.js";
|
|
2
2
|
import { DBaseStateSet } from "../d-base-state-set";
|
|
3
3
|
import { DFocusableMightBe } from "../d-controller-focus";
|
|
4
|
+
import { UtilHtmlElementClipperEx } from "./util-html-element-clipper-ex";
|
|
5
|
+
import { UtilHtmlElementClipperExRects } from "./util-html-element-clipper-ex-rects";
|
|
4
6
|
import { UtilHtmlElementWhen } from "./util-html-element-when";
|
|
5
7
|
export interface UtilHtmlElementPaddingLTRB {
|
|
6
8
|
getLeft(): number;
|
|
@@ -14,7 +16,7 @@ export interface UtilHtmlElementPaddingVH {
|
|
|
14
16
|
}
|
|
15
17
|
export declare type UtilHtmlElementPadding = UtilHtmlElementPaddingVH | UtilHtmlElementPaddingLTRB;
|
|
16
18
|
export declare type UtilHtmlElementCreator<T extends HTMLElement> = (container: HTMLElement) => T | null;
|
|
17
|
-
export declare type UtilHtmlElementStyler<T extends HTMLElement> = (target: T, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null) => void;
|
|
19
|
+
export declare type UtilHtmlElementStyler<T extends HTMLElement> = (target: T, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null, clipperEx: UtilHtmlElementClipperEx | null | undefined) => void;
|
|
18
20
|
export declare type UtilHtmlElementStylerBefore = (target: HTMLDivElement) => void;
|
|
19
21
|
export declare type UtilHtmlElementStylerAfter = (target: HTMLDivElement) => void;
|
|
20
22
|
export declare type UtilHtmlElementToRect = (resolution: number, work: Point, result: Rectangle) => Rectangle | null;
|
|
@@ -26,6 +28,7 @@ export interface UtilHtmlElementElementOptions<ELEMENT extends HTMLElement> {
|
|
|
26
28
|
export interface UtilHtmlElementClipperOptions {
|
|
27
29
|
creator?: UtilHtmlElementCreator<HTMLDivElement>;
|
|
28
30
|
styler?: UtilHtmlElementStyler<HTMLDivElement>;
|
|
31
|
+
extended?: boolean;
|
|
29
32
|
}
|
|
30
33
|
export interface UtilHtmlElementBeforeOptions {
|
|
31
34
|
creator?: UtilHtmlElementCreator<HTMLDivElement>;
|
|
@@ -45,9 +48,10 @@ export interface UtilHtmlElementOptions<ELEMENT extends HTMLElement = HTMLElemen
|
|
|
45
48
|
}
|
|
46
49
|
export interface UtilThemeHtmlElement<ELEMENT extends HTMLElement> {
|
|
47
50
|
getElementCreator(): UtilHtmlElementCreator<ELEMENT>;
|
|
48
|
-
setElementStyle(target: ELEMENT, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null): void;
|
|
51
|
+
setElementStyle(target: ELEMENT, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null, clipperEx: UtilHtmlElementClipperEx | null | undefined): void;
|
|
49
52
|
getClipperCreator(): UtilHtmlElementCreator<HTMLDivElement>;
|
|
50
|
-
setClipperStyle(target: HTMLDivElement, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null): void;
|
|
53
|
+
setClipperStyle(target: HTMLDivElement, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null, clipperEx: UtilHtmlElementClipperEx | null | undefined): void;
|
|
54
|
+
isClipperExEnabled(): boolean;
|
|
51
55
|
getBeforeCreator(): UtilHtmlElementCreator<HTMLDivElement>;
|
|
52
56
|
setBeforeStyle(target: HTMLDivElement): void;
|
|
53
57
|
getAfterCreator(): UtilHtmlElementCreator<HTMLDivElement>;
|
|
@@ -62,6 +66,7 @@ export interface UtilHtmlElementElementData<ELEMENT extends HTMLElement> {
|
|
|
62
66
|
export interface UtilHtmlElementClipperData {
|
|
63
67
|
creator: UtilHtmlElementCreator<HTMLDivElement>;
|
|
64
68
|
styler: UtilHtmlElementStyler<HTMLDivElement>;
|
|
69
|
+
extended: boolean;
|
|
65
70
|
}
|
|
66
71
|
export interface UtilHtmlElementBeforeData {
|
|
67
72
|
creator: UtilHtmlElementCreator<HTMLDivElement>;
|
|
@@ -89,6 +94,7 @@ export interface UtilHtmlElementOperation<ELEMENT extends HTMLElement> {
|
|
|
89
94
|
getElementRect(resolution: number, work: Point, result: Rectangle): Rectangle | null;
|
|
90
95
|
getElementMatrix(): Matrix | null;
|
|
91
96
|
getClipperRect(resolution: number, work: Point, result: Rectangle): Rectangle | null;
|
|
97
|
+
getClipperExRects?(result: UtilHtmlElementClipperExRects): void;
|
|
92
98
|
getPadding(): UtilHtmlElementPadding | null;
|
|
93
99
|
containsPoint(point: Point): boolean;
|
|
94
100
|
onStart(): void;
|
|
@@ -102,6 +108,8 @@ export declare class UtilHtmlElement<ELEMENT extends HTMLElement = HTMLElement,
|
|
|
102
108
|
protected _point?: Point;
|
|
103
109
|
protected _clipper?: HTMLDivElement | null;
|
|
104
110
|
protected _clipperRectResult?: Rectangle;
|
|
111
|
+
protected _clipperEx?: UtilHtmlElementClipperEx | null;
|
|
112
|
+
protected _clipperExRects?: UtilHtmlElementClipperExRects | null;
|
|
105
113
|
protected _element?: ELEMENT | null;
|
|
106
114
|
protected _elementRectResult?: Rectangle;
|
|
107
115
|
protected _isElementShown: boolean;
|
|
@@ -119,9 +127,9 @@ export declare class UtilHtmlElement<ELEMENT extends HTMLElement = HTMLElement,
|
|
|
119
127
|
constructor(target: TARGET, operation: OPERATION, theme: THEME, options?: OPTIONS);
|
|
120
128
|
protected toData(theme: THEME, options?: OPTIONS): UtilHtmlElementData<ELEMENT>;
|
|
121
129
|
protected toElementData(theme: THEME, options?: OPTIONS["element"]): UtilHtmlElementElementData<ELEMENT>;
|
|
122
|
-
protected newElementStyler(theme: THEME): (target: ELEMENT, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null) => void;
|
|
130
|
+
protected newElementStyler(theme: THEME): (target: ELEMENT, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null, clipperEx: UtilHtmlElementClipperEx | null | undefined) => void;
|
|
123
131
|
protected toClipperData(theme: THEME, options?: OPTIONS["clipper"]): UtilHtmlElementClipperData;
|
|
124
|
-
protected newClipperStyler(theme: THEME): (target: HTMLDivElement, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null) => void;
|
|
132
|
+
protected newClipperStyler(theme: THEME): (target: HTMLDivElement, state: DBaseStateSet, padding: UtilHtmlElementPadding | null, elementRect: Rectangle | null, elementMatrix: Matrix | null, clipperRect: Rectangle | null, clipperEx: UtilHtmlElementClipperEx | null | undefined) => void;
|
|
125
133
|
protected toBeforeData(theme: THEME, options?: OPTIONS["before"]): UtilHtmlElementBeforeData;
|
|
126
134
|
protected newBeforeStyler(theme: THEME): (target: HTMLDivElement) => void;
|
|
127
135
|
protected toAfterData(theme: THEME, options?: OPTIONS["after"]): UtilHtmlElementAfterData;
|
|
@@ -140,6 +148,7 @@ export declare class UtilHtmlElement<ELEMENT extends HTMLElement = HTMLElement,
|
|
|
140
148
|
protected getElementRect(resolution: number): Rectangle | null;
|
|
141
149
|
protected getElementMatrix(): Matrix | null;
|
|
142
150
|
protected getClipperRect(resolution: number): Rectangle | null;
|
|
151
|
+
protected fillClipperExRects(resolution: number, result: UtilHtmlElementClipperExRects): boolean;
|
|
143
152
|
protected doStart(renderer?: Renderer): void;
|
|
144
153
|
protected toElementFocused(element: ELEMENT): void;
|
|
145
154
|
protected onStart(): void;
|
|
@@ -149,6 +158,8 @@ export declare class UtilHtmlElement<ELEMENT extends HTMLElement = HTMLElement,
|
|
|
149
158
|
protected onElementAttached(element: ELEMENT, before?: HTMLDivElement | null, after?: HTMLDivElement | null): void;
|
|
150
159
|
protected onElementDetached(element: ELEMENT, before?: HTMLDivElement | null, after?: HTMLDivElement | null): void;
|
|
151
160
|
protected getClipper(): HTMLDivElement | null;
|
|
161
|
+
protected getClipperEx(clipper: HTMLDivElement): UtilHtmlElementClipperEx | null;
|
|
162
|
+
protected getClipperExRects(): UtilHtmlElementClipperExRects | null;
|
|
152
163
|
protected getElement(clipper: HTMLDivElement): ELEMENT | null;
|
|
153
164
|
protected getBefore(clipper: HTMLDivElement): HTMLDivElement | null;
|
|
154
165
|
protected getAfter(clipper: HTMLDivElement): HTMLDivElement | null;
|
|
@@ -10,6 +10,8 @@ import { UtilHtmlElementWhen } from "../../util/util-html-element-when";
|
|
|
10
10
|
import { EShapeActionExpressions } from "./e-shape-action-expressions";
|
|
11
11
|
import { EShapeActionRuntime } from "./e-shape-action-runtime";
|
|
12
12
|
import { EShapeActionRuntimes } from "./e-shape-action-runtimes";
|
|
13
|
+
import { DDiagramLayer } from "../../d-diagram-layer";
|
|
14
|
+
import { isShapeClipperExLoaded } from "../load/load-shape-clipper-ex";
|
|
13
15
|
var EShapeActionRuntimeMiscHtmlElementBase = /** @class */ (function (_super) {
|
|
14
16
|
__extends(EShapeActionRuntimeMiscHtmlElementBase, _super);
|
|
15
17
|
function EShapeActionRuntimeMiscHtmlElementBase(value) {
|
|
@@ -42,6 +44,9 @@ var EShapeActionRuntimeMiscHtmlElementBase = /** @class */ (function (_super) {
|
|
|
42
44
|
getClipperRect: function (resolution, work, result) {
|
|
43
45
|
return _this.getClipperToRect(shape, runtime, resolution, work, result);
|
|
44
46
|
},
|
|
47
|
+
getClipperExRects: function (result) {
|
|
48
|
+
_this.getClipperExRects(shape, result);
|
|
49
|
+
},
|
|
45
50
|
getPadding: function () {
|
|
46
51
|
return _this.getPadding(shape, runtime);
|
|
47
52
|
},
|
|
@@ -64,7 +69,10 @@ var EShapeActionRuntimeMiscHtmlElementBase = /** @class */ (function (_super) {
|
|
|
64
69
|
element: {
|
|
65
70
|
creator: this.newElementCreator(shape, runtime)
|
|
66
71
|
},
|
|
67
|
-
when: this.toWhen(shape, runtime)
|
|
72
|
+
when: this.toWhen(shape, runtime),
|
|
73
|
+
clipper: {
|
|
74
|
+
extended: isShapeClipperExLoaded()
|
|
75
|
+
}
|
|
68
76
|
};
|
|
69
77
|
};
|
|
70
78
|
EShapeActionRuntimeMiscHtmlElementBase.prototype.toWhen = function (shape, runtime) {
|
|
@@ -75,9 +83,9 @@ var EShapeActionRuntimeMiscHtmlElementBase = /** @class */ (function (_super) {
|
|
|
75
83
|
return undefined;
|
|
76
84
|
};
|
|
77
85
|
EShapeActionRuntimeMiscHtmlElementBase.prototype.containsPoint = function (shape, runtime, point) {
|
|
86
|
+
var _a;
|
|
78
87
|
if (shape.visible) {
|
|
79
|
-
var local = EShapeActionRuntimeMiscHtmlElementBase.WORK
|
|
80
|
-
EShapeActionRuntimeMiscHtmlElementBase.WORK = local;
|
|
88
|
+
var local = ((_a = EShapeActionRuntimeMiscHtmlElementBase.WORK) !== null && _a !== void 0 ? _a : (EShapeActionRuntimeMiscHtmlElementBase.WORK = new Point()));
|
|
81
89
|
shape.toLocal(point, undefined, local);
|
|
82
90
|
return shape.contains(local.x, local.y) != null;
|
|
83
91
|
}
|
|
@@ -105,6 +113,35 @@ var EShapeActionRuntimeMiscHtmlElementBase = /** @class */ (function (_super) {
|
|
|
105
113
|
var container = EShapeActionRuntimes.toContainer(shape);
|
|
106
114
|
return UtilHtmlElement.getClipperRect(container, shape, resolution, point, result);
|
|
107
115
|
};
|
|
116
|
+
EShapeActionRuntimeMiscHtmlElementBase.prototype.getClipperExRects = function (shape, result) {
|
|
117
|
+
result.begin();
|
|
118
|
+
var target = shape.root.parent;
|
|
119
|
+
if (target instanceof DDiagramLayer) {
|
|
120
|
+
var layerContainer = target.parent;
|
|
121
|
+
if (layerContainer != null) {
|
|
122
|
+
var layers = layerContainer.children;
|
|
123
|
+
var index = layers.indexOf(target);
|
|
124
|
+
if (0 <= index) {
|
|
125
|
+
for (var i = index + 1, imax = layers.length; i < imax; ++i) {
|
|
126
|
+
var layer = layers[i];
|
|
127
|
+
if (layer.visible) {
|
|
128
|
+
var w = layer.width;
|
|
129
|
+
var h = layer.height;
|
|
130
|
+
var t = layer.transform.worldTransform;
|
|
131
|
+
var a = t.a;
|
|
132
|
+
var b = t.b;
|
|
133
|
+
var c = t.c;
|
|
134
|
+
var d = t.d;
|
|
135
|
+
var tx = t.tx;
|
|
136
|
+
var ty = t.ty;
|
|
137
|
+
result.add(tx, ty, a * w + c * h + tx, b * w + d * h + ty);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
result.end();
|
|
144
|
+
};
|
|
108
145
|
EShapeActionRuntimeMiscHtmlElementBase.prototype.onRender = function (shape, runtime, time, renderer) {
|
|
109
146
|
this.getUtil(shape, runtime).onRender(renderer);
|
|
110
147
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-action-runtime-misc-html-element-base.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-runtime-misc-html-element-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAuB,KAAK,EAAuB,MAAM,SAAS,CAAC;AAG1E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACN,eAAe,EAKf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAIxE,OAAO,EAAE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Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, Matrix, Point, Rectangle, Renderer } from \"pixi.js\";\nimport InteractionEvent = interaction.InteractionEvent;\nimport InteractionManager = interaction.InteractionManager;\nimport { DThemes } from \"../../theme/d-themes\";\nimport {\n\tUtilHtmlElement,\n\tUtilHtmlElementCreator,\n\tUtilHtmlElementOperation,\n\tUtilHtmlElementOptions,\n\tUtilHtmlElementPadding\n} from \"../../util/util-html-element\";\nimport { UtilHtmlElementWhen } from \"../../util/util-html-element-when\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeRuntime } from \"../e-shape-runtime\";\nimport { EShapeActionExpression } from \"./e-shape-action-expression\";\nimport { EShapeActionExpressions } from \"./e-shape-action-expressions\";\nimport { EShapeActionRuntime } from \"./e-shape-action-runtime\";\nimport { EShapeActionRuntimes } from \"./e-shape-action-runtimes\";\nimport { EShapeActionValueMisc } from \"./e-shape-action-value-misc\";\n\nexport abstract class EShapeActionRuntimeMiscHtmlElementBase<\n\tELEMENT extends HTMLElement = HTMLElement,\n\tUTIL extends UtilHtmlElement<ELEMENT> = UtilHtmlElement<ELEMENT>\n> extends EShapeActionRuntime {\n\tprotected static WORK?: Point;\n\tprotected readonly condition: EShapeActionExpression<string | null>;\n\tprotected utils: Map<EShape, UTIL>;\n\n\tconstructor(value: EShapeActionValueMisc) {\n\t\tsuper();\n\t\tthis.condition = EShapeActionExpressions.ofString(value.condition);\n\t\tthis.utils = new Map<EShape, UTIL>();\n\t}\n\n\tprotected getUtil(shape: EShape, runtime: EShapeRuntime): UTIL {\n\t\tconst utils = this.utils;\n\t\tlet result = utils.get(shape);\n\t\tif (result == null) {\n\t\t\tresult = this.newUtil(shape, runtime);\n\t\t\tutils.set(shape, result);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newUtil(shape: EShape, runtime: EShapeRuntime): UTIL {\n\t\treturn new UtilHtmlElement<ELEMENT>(\n\t\t\tshape,\n\t\t\tthis.newOperation(shape, runtime),\n\t\t\tDThemes.getInstance().get(\"DHtmlElement\"),\n\t\t\tthis.newUtilOptions(shape, runtime)\n\t\t) as any;\n\t}\n\n\tprotected newOperation(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime\n\t): UtilHtmlElementOperation<ELEMENT> {\n\t\treturn {\n\t\t\tgetElementRect: (\n\t\t\t\tresolution: number,\n\t\t\t\twork: Point,\n\t\t\t\tresult: Rectangle\n\t\t\t): Rectangle | null => {\n\t\t\t\treturn this.getElementRect(shape, runtime, resolution, work, result);\n\t\t\t},\n\n\t\t\tgetElementMatrix: (): Matrix | null => {\n\t\t\t\treturn this.getElementMatrix(shape, runtime);\n\t\t\t},\n\n\t\t\tgetClipperRect: (\n\t\t\t\tresolution: number,\n\t\t\t\twork: Point,\n\t\t\t\tresult: Rectangle\n\t\t\t): Rectangle | null => {\n\t\t\t\treturn this.getClipperToRect(shape, runtime, resolution, work, result);\n\t\t\t},\n\n\t\t\tgetPadding: (): UtilHtmlElementPadding | null => {\n\t\t\t\treturn this.getPadding(shape, runtime);\n\t\t\t},\n\n\t\t\tcontainsPoint: (point: Point): boolean => {\n\t\t\t\treturn this.containsPoint(shape, runtime, point);\n\t\t\t},\n\n\t\t\tonStart: (): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t},\n\n\t\t\tonCancel: (): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t},\n\n\t\t\tonEnd: (): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected newUtilOptions(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime\n\t): UtilHtmlElementOptions<ELEMENT> {\n\t\treturn {\n\t\t\telement: {\n\t\t\t\tcreator: this.newElementCreator(shape, runtime)\n\t\t\t},\n\t\t\twhen: this.toWhen(shape, runtime)\n\t\t};\n\t}\n\n\tprotected abstract newElementCreator(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime\n\t): UtilHtmlElementCreator<ELEMENT> | undefined;\n\n\tprotected toWhen(shape: EShape, runtime: EShapeRuntime): UtilHtmlElementWhen | undefined {\n\t\tconst value = this.condition(shape, Date.now());\n\t\tif (value != null && value in UtilHtmlElementWhen) {\n\t\t\treturn UtilHtmlElementWhen[value as keyof typeof UtilHtmlElementWhen];\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprotected containsPoint(shape: EShape, runtime: EShapeRuntime, point: Point): boolean {\n\t\tif (shape.visible) {\n\t\t\tconst local = EShapeActionRuntimeMiscHtmlElementBase.WORK || new Point();\n\t\t\tEShapeActionRuntimeMiscHtmlElementBase.WORK = local;\n\t\t\tshape.toLocal(point, undefined, local);\n\t\t\treturn shape.contains(local.x, local.y) != null;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected getPadding(shape: EShape, runtime: EShapeRuntime): UtilHtmlElementPadding | null {\n\t\treturn null;\n\t}\n\n\tprotected getElementRect(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime,\n\t\tresolution: number,\n\t\tpoint: Point,\n\t\tresult: Rectangle\n\t): Rectangle | null {\n\t\tconst pivot = shape.transform.pivot;\n\t\tconst size = shape.size;\n\t\tconst sizeX = size.x;\n\t\tconst sizeY = size.y;\n\t\tresult.x = -0.5 * sizeX + pivot.x;\n\t\tresult.y = -0.5 * sizeY + pivot.y;\n\t\tresult.width = sizeX;\n\t\tresult.height = sizeY;\n\t\treturn result;\n\t}\n\n\tprotected getElementMatrix(shape: EShape, runtime: EShapeRuntime): Matrix | null {\n\t\tshape.updateTransform();\n\t\treturn shape.transform.worldTransform;\n\t}\n\n\tprotected getClipperToRect(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime,\n\t\tresolution: number,\n\t\tpoint: Point,\n\t\tresult: Rectangle\n\t): Rectangle | null {\n\t\tconst container = EShapeActionRuntimes.toContainer(shape);\n\t\treturn UtilHtmlElement.getClipperRect(container, shape, resolution, point, result);\n\t}\n\n\tonRender(shape: EShape, runtime: EShapeRuntime, time: number, renderer: Renderer): void {\n\t\tthis.getUtil(shape, runtime).onRender(renderer);\n\t}\n\n\tonFocus(shape: EShape, runtime: EShapeRuntime): void {\n\t\tthis.getUtil(shape, runtime).onFocus();\n\t}\n\n\tonBlur(shape: EShape, runtime: EShapeRuntime): void {\n\t\tthis.getUtil(shape, runtime).onBlur();\n\t}\n\n\tonDowning(shape: EShape, runtime: EShapeRuntime, e: InteractionEvent | KeyboardEvent): void {\n\t\tthis.getUtil(shape, runtime).onDowning(e);\n\t}\n\n\tonDown(shape: EShape, runtime: EShapeRuntime, e: InteractionEvent | KeyboardEvent): void {\n\t\tthis.getUtil(shape, runtime).onDown(e);\n\t}\n\n\tonDblClick(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime,\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: InteractionManager\n\t): void {\n\t\tthis.getUtil(shape, runtime).onDblClick(e, interactionManager);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"e-shape-action-runtime-misc-html-element-base.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-runtime-misc-html-element-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAuB,KAAK,EAAuB,MAAM,SAAS,CAAC;AAG1E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACN,eAAe,EAKf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAIxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;IAGU,0DAAmB;IAK5B,gDAAY,KAA4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AAE,kBAAkB,CAAC,CAAC;IAChE,CAAC;IACF,6CAAC;AAAD,CAAC,AAzND,CAGU,mBAAmB,GAsN5B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, Matrix, Point, Rectangle, Renderer } from \"pixi.js\";\nimport InteractionEvent = interaction.InteractionEvent;\nimport InteractionManager = interaction.InteractionManager;\nimport { DThemes } from \"../../theme/d-themes\";\nimport {\n\tUtilHtmlElement,\n\tUtilHtmlElementCreator,\n\tUtilHtmlElementOperation,\n\tUtilHtmlElementOptions,\n\tUtilHtmlElementPadding\n} from \"../../util/util-html-element\";\nimport { UtilHtmlElementWhen } from \"../../util/util-html-element-when\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeRuntime } from \"../e-shape-runtime\";\nimport { EShapeActionExpression } from \"./e-shape-action-expression\";\nimport { EShapeActionExpressions } from \"./e-shape-action-expressions\";\nimport { EShapeActionRuntime } from \"./e-shape-action-runtime\";\nimport { EShapeActionRuntimes } from \"./e-shape-action-runtimes\";\nimport { EShapeActionValueMisc } from \"./e-shape-action-value-misc\";\nimport { UtilHtmlElementClipperExRects } from \"../../util/util-html-element-clipper-ex-rects\";\nimport { EShapeContainer } from \"../e-shape-container\";\nimport { DDiagramLayer } from \"../../d-diagram-layer\";\nimport { isShapeClipperExLoaded } from \"../load/load-shape-clipper-ex\";\n\nexport abstract class EShapeActionRuntimeMiscHtmlElementBase<\n\tELEMENT extends HTMLElement = HTMLElement,\n\tUTIL extends UtilHtmlElement<ELEMENT> = UtilHtmlElement<ELEMENT>\n> extends EShapeActionRuntime {\n\tprotected static WORK?: Point;\n\tprotected readonly condition: EShapeActionExpression<string | null>;\n\tprotected utils: Map<EShape, UTIL>;\n\n\tconstructor(value: EShapeActionValueMisc) {\n\t\tsuper();\n\t\tthis.condition = EShapeActionExpressions.ofString(value.condition);\n\t\tthis.utils = new Map<EShape, UTIL>();\n\t}\n\n\tprotected getUtil(shape: EShape, runtime: EShapeRuntime): UTIL {\n\t\tconst utils = this.utils;\n\t\tlet result = utils.get(shape);\n\t\tif (result == null) {\n\t\t\tresult = this.newUtil(shape, runtime);\n\t\t\tutils.set(shape, result);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newUtil(shape: EShape, runtime: EShapeRuntime): UTIL {\n\t\treturn new UtilHtmlElement<ELEMENT>(\n\t\t\tshape,\n\t\t\tthis.newOperation(shape, runtime),\n\t\t\tDThemes.getInstance().get(\"DHtmlElement\"),\n\t\t\tthis.newUtilOptions(shape, runtime)\n\t\t) as any;\n\t}\n\n\tprotected newOperation(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime\n\t): UtilHtmlElementOperation<ELEMENT> {\n\t\treturn {\n\t\t\tgetElementRect: (\n\t\t\t\tresolution: number,\n\t\t\t\twork: Point,\n\t\t\t\tresult: Rectangle\n\t\t\t): Rectangle | null => {\n\t\t\t\treturn this.getElementRect(shape, runtime, resolution, work, result);\n\t\t\t},\n\n\t\t\tgetElementMatrix: (): Matrix | null => {\n\t\t\t\treturn this.getElementMatrix(shape, runtime);\n\t\t\t},\n\n\t\t\tgetClipperRect: (\n\t\t\t\tresolution: number,\n\t\t\t\twork: Point,\n\t\t\t\tresult: Rectangle\n\t\t\t): Rectangle | null => {\n\t\t\t\treturn this.getClipperToRect(shape, runtime, resolution, work, result);\n\t\t\t},\n\n\t\t\tgetClipperExRects: (result: UtilHtmlElementClipperExRects): void => {\n\t\t\t\tthis.getClipperExRects(shape, result);\n\t\t\t},\n\n\t\t\tgetPadding: (): UtilHtmlElementPadding | null => {\n\t\t\t\treturn this.getPadding(shape, runtime);\n\t\t\t},\n\n\t\t\tcontainsPoint: (point: Point): boolean => {\n\t\t\t\treturn this.containsPoint(shape, runtime, point);\n\t\t\t},\n\n\t\t\tonStart: (): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t},\n\n\t\t\tonCancel: (): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t},\n\n\t\t\tonEnd: (): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected newUtilOptions(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime\n\t): UtilHtmlElementOptions<ELEMENT> {\n\t\treturn {\n\t\t\telement: {\n\t\t\t\tcreator: this.newElementCreator(shape, runtime)\n\t\t\t},\n\t\t\twhen: this.toWhen(shape, runtime),\n\t\t\tclipper: {\n\t\t\t\textended: isShapeClipperExLoaded()\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected abstract newElementCreator(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime\n\t): UtilHtmlElementCreator<ELEMENT> | undefined;\n\n\tprotected toWhen(shape: EShape, runtime: EShapeRuntime): UtilHtmlElementWhen | undefined {\n\t\tconst value = this.condition(shape, Date.now());\n\t\tif (value != null && value in UtilHtmlElementWhen) {\n\t\t\treturn UtilHtmlElementWhen[value as keyof typeof UtilHtmlElementWhen];\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprotected containsPoint(shape: EShape, runtime: EShapeRuntime, point: Point): boolean {\n\t\tif (shape.visible) {\n\t\t\tconst local = (EShapeActionRuntimeMiscHtmlElementBase.WORK ??= new Point());\n\t\t\tshape.toLocal(point, undefined, local);\n\t\t\treturn shape.contains(local.x, local.y) != null;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected getPadding(shape: EShape, runtime: EShapeRuntime): UtilHtmlElementPadding | null {\n\t\treturn null;\n\t}\n\n\tprotected getElementRect(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime,\n\t\tresolution: number,\n\t\tpoint: Point,\n\t\tresult: Rectangle\n\t): Rectangle | null {\n\t\tconst pivot = shape.transform.pivot;\n\t\tconst size = shape.size;\n\t\tconst sizeX = size.x;\n\t\tconst sizeY = size.y;\n\t\tresult.x = -0.5 * sizeX + pivot.x;\n\t\tresult.y = -0.5 * sizeY + pivot.y;\n\t\tresult.width = sizeX;\n\t\tresult.height = sizeY;\n\t\treturn result;\n\t}\n\n\tprotected getElementMatrix(shape: EShape, runtime: EShapeRuntime): Matrix | null {\n\t\tshape.updateTransform();\n\t\treturn shape.transform.worldTransform;\n\t}\n\n\tprotected getClipperToRect(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime,\n\t\tresolution: number,\n\t\tpoint: Point,\n\t\tresult: Rectangle\n\t): Rectangle | null {\n\t\tconst container = EShapeActionRuntimes.toContainer(shape);\n\t\treturn UtilHtmlElement.getClipperRect(container, shape, resolution, point, result);\n\t}\n\n\tprotected getClipperExRects(shape: EShape, result: UtilHtmlElementClipperExRects): void {\n\t\tresult.begin();\n\t\tconst target = shape.root.parent as EShapeContainer | null;\n\t\tif (target instanceof DDiagramLayer) {\n\t\t\tconst layerContainer = target.parent;\n\t\t\tif (layerContainer != null) {\n\t\t\t\tconst layers = layerContainer.children as DDiagramLayer[];\n\t\t\t\tconst index = layers.indexOf(target);\n\t\t\t\tif (0 <= index) {\n\t\t\t\t\tfor (let i = index + 1, imax = layers.length; i < imax; ++i) {\n\t\t\t\t\t\tconst layer = layers[i];\n\t\t\t\t\t\tif (layer.visible) {\n\t\t\t\t\t\t\tconst w = layer.width;\n\t\t\t\t\t\t\tconst h = layer.height;\n\t\t\t\t\t\t\tconst t = layer.transform.worldTransform;\n\t\t\t\t\t\t\tconst a = t.a;\n\t\t\t\t\t\t\tconst b = t.b;\n\t\t\t\t\t\t\tconst c = t.c;\n\t\t\t\t\t\t\tconst d = t.d;\n\t\t\t\t\t\t\tconst tx = t.tx;\n\t\t\t\t\t\t\tconst ty = t.ty;\n\t\t\t\t\t\t\tresult.add(tx, ty, a * w + c * h + tx, b * w + d * h + ty);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tresult.end();\n\t}\n\n\tonRender(shape: EShape, runtime: EShapeRuntime, time: number, renderer: Renderer): void {\n\t\tthis.getUtil(shape, runtime).onRender(renderer);\n\t}\n\n\tonFocus(shape: EShape, runtime: EShapeRuntime): void {\n\t\tthis.getUtil(shape, runtime).onFocus();\n\t}\n\n\tonBlur(shape: EShape, runtime: EShapeRuntime): void {\n\t\tthis.getUtil(shape, runtime).onBlur();\n\t}\n\n\tonDowning(shape: EShape, runtime: EShapeRuntime, e: InteractionEvent | KeyboardEvent): void {\n\t\tthis.getUtil(shape, runtime).onDowning(e);\n\t}\n\n\tonDown(shape: EShape, runtime: EShapeRuntime, e: InteractionEvent | KeyboardEvent): void {\n\t\tthis.getUtil(shape, runtime).onDown(e);\n\t}\n\n\tonDblClick(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime,\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: InteractionManager\n\t): void {\n\t\tthis.getUtil(shape, runtime).onDblClick(e, interactionManager);\n\t}\n}\n"]}
|
|
@@ -26,6 +26,9 @@ var EShapeActionRuntimeMiscInput = /** @class */ (function (_super) {
|
|
|
26
26
|
getClipperRect: function (resolution, work, result) {
|
|
27
27
|
return _this.getClipperToRect(shape, runtime, resolution, work, result);
|
|
28
28
|
},
|
|
29
|
+
getClipperExRects: function (result) {
|
|
30
|
+
_this.getClipperExRects(shape, result);
|
|
31
|
+
},
|
|
29
32
|
getPadding: function () {
|
|
30
33
|
return _this.getPadding(shape, runtime);
|
|
31
34
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-action-runtime-misc-input.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-runtime-misc-input.ts"],"names":[],"mappings":"AAAA;;;GAGG;;
|
|
1
|
+
{"version":3,"file":"e-shape-action-runtime-misc-input.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-runtime-misc-input.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AASH,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,sCAAsC,EAAE,MAAM,iDAAiD,CAAC;AA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AAC;AAAD,CAAC,AAnHD,CAIU,sCAAsC,GA+G/C","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Matrix, Point, Rectangle } from \"pixi.js\";\nimport { UtilHtmlElementCreator, UtilHtmlElementPadding } from \"../../util/util-html-element\";\nimport { UtilHtmlElementClipperExRects } from \"../../util/util-html-element-clipper-ex-rects\";\nimport { UtilInput, UtilInputOperation } from \"../../util/util-input\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeRuntime } from \"../e-shape-runtime\";\nimport { EShapeActionExpression } from \"./e-shape-action-expression\";\nimport { EShapeActionExpressions } from \"./e-shape-action-expressions\";\nimport { EShapeActionRuntimeMiscHtmlElementBase } from \"./e-shape-action-runtime-misc-html-element-base\";\nimport { EShapeActionValueMisc } from \"./e-shape-action-value-misc\";\nimport { EShapeActionValueOnInputAction } from \"./e-shape-action-value-on-input-action\";\nimport { EShapeActionValueOnInputActions } from \"./e-shape-action-value-on-input-actions\";\n\nexport abstract class EShapeActionRuntimeMiscInput<\n\tVALUE = unknown,\n\tELEMENT extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement | HTMLTextAreaElement,\n\tUTIL extends UtilInput<VALUE, ELEMENT> = UtilInput<VALUE, ELEMENT>\n> extends EShapeActionRuntimeMiscHtmlElementBase<ELEMENT, UTIL> {\n\tprotected readonly target: EShapeActionExpression<string | null>;\n\tprotected onInputAction: EShapeActionValueOnInputAction;\n\n\tconstructor(value: EShapeActionValueMisc) {\n\t\tsuper(value);\n\t\tthis.target = EShapeActionExpressions.ofStringOrNull(value.target);\n\t\tthis.onInputAction = value.onInputAction;\n\t}\n\n\tprotected newOperation(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime\n\t): UtilInputOperation<VALUE, ELEMENT> {\n\t\treturn {\n\t\t\tgetElementRect: (\n\t\t\t\tresolution: number,\n\t\t\t\twork: Point,\n\t\t\t\tresult: Rectangle\n\t\t\t): Rectangle | null => {\n\t\t\t\treturn this.getElementRect(shape, runtime, resolution, work, result);\n\t\t\t},\n\n\t\t\tgetElementMatrix: (): Matrix | null => {\n\t\t\t\treturn this.getElementMatrix(shape, runtime);\n\t\t\t},\n\n\t\t\tgetClipperRect: (\n\t\t\t\tresolution: number,\n\t\t\t\twork: Point,\n\t\t\t\tresult: Rectangle\n\t\t\t): Rectangle | null => {\n\t\t\t\treturn this.getClipperToRect(shape, runtime, resolution, work, result);\n\t\t\t},\n\n\t\t\tgetClipperExRects: (result: UtilHtmlElementClipperExRects): void => {\n\t\t\t\tthis.getClipperExRects(shape, result);\n\t\t\t},\n\n\t\t\tgetPadding: (): UtilHtmlElementPadding | null => {\n\t\t\t\treturn this.getPadding(shape, runtime);\n\t\t\t},\n\n\t\t\tcontainsPoint: (point: Point): boolean => {\n\t\t\t\treturn this.containsPoint(shape, runtime, point);\n\t\t\t},\n\n\t\t\tonStart: (): void => {\n\t\t\t\tshape.text.enable = false;\n\t\t\t},\n\n\t\t\tonCancel: (): void => {\n\t\t\t\tshape.text.enable = true;\n\t\t\t},\n\n\t\t\tonEnd: (): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t},\n\n\t\t\tgetValue: (): VALUE | undefined => {\n\t\t\t\treturn this.getUtil(shape, runtime).toValue(shape.text.value);\n\t\t\t},\n\n\t\t\tonValueInput: (newValue: VALUE): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t},\n\n\t\t\tonValueChange: (newValue: VALUE, oldValue: VALUE): void => {\n\t\t\t\tthis.onValueChange(shape, runtime, newValue, oldValue);\n\t\t\t},\n\n\t\t\tonEnter: (): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t},\n\n\t\t\tapplyTitle: (): void => {\n\t\t\t\t// DO NOTHING\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected newElementCreator(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime\n\t): UtilHtmlElementCreator<ELEMENT> | undefined {\n\t\treturn undefined;\n\t}\n\n\tprotected getPadding(shape: EShape, runtime: EShapeRuntime): UtilHtmlElementPadding | null {\n\t\treturn shape.text.padding;\n\t}\n\n\tprotected onValueChange(\n\t\tshape: EShape,\n\t\truntime: EShapeRuntime,\n\t\tnewValue: VALUE,\n\t\toldValue: VALUE\n\t): void {\n\t\tshape.text.value = this.getUtil(shape, runtime).fromValue(newValue);\n\t\tconst now = Date.now();\n\t\tconst target = this.target(shape, now);\n\t\tif (target != null) {\n\t\t\tEShapeActionValueOnInputActions.execute(\n\t\t\t\tshape,\n\t\t\t\tthis.onInputAction,\n\t\t\t\ttarget,\n\t\t\t\tnewValue,\n\t\t\t\tnow\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
|