@operato/scene-bpmn 10.0.0-beta.2 → 10.0.0-beta.65
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/README.md
CHANGED
|
@@ -1,13 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
# @operato/scene-bpmn
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> bpmn components for things-scene
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
| ---- | ----------------------- | -------------- | ------ |
|
|
7
|
-
| UMD | things-scene-bpmn.js | modern browser | O |
|
|
8
|
-
| UMD | things-scene-bpmn-ie.js | ie 11 | O |
|
|
9
|
-
| ESM | things-scene-bpmn.mjs | modern browser | O |
|
|
5
|
+
<!-- AUTOGEN_BEGIN: do not edit between markers (run scripts/regenerate-readmes.mjs to update) -->
|
|
10
6
|
|
|
11
|
-
##
|
|
7
|
+
## Components
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
- `BPMNComment`
|
|
10
|
+
- `BPMNDataObject`
|
|
11
|
+
- `BPMNDataStore`
|
|
12
|
+
- `BPMNEvent`
|
|
13
|
+
- `BPMNFlow`
|
|
14
|
+
- `BPMNGateway`
|
|
15
|
+
- `BPMNGroup`
|
|
16
|
+
- `BPMNLane`
|
|
17
|
+
- `BPMNPool`
|
|
18
|
+
- `BPMNSubprocess`
|
|
19
|
+
- `BPMNExpandedSubprocess`
|
|
20
|
+
- `BPMNTask`
|
|
21
|
+
- `BPMNMessage`
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yarn add @operato/scene-bpmn
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { BPMNComment, BPMNDataObject, BPMNDataStore, BPMNEvent, BPMNFlow } from '@operato/scene-bpmn'
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Build
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
yarn build
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Output: ESM module at `dist/index.js` (single bundle, no UMD/IE legacy).
|
|
42
|
+
|
|
43
|
+
_Version: 10.0.0-beta.2_
|
|
44
|
+
|
|
45
|
+
<!-- AUTOGEN_END -->
|
|
@@ -63,7 +63,7 @@ declare const BPMNContainerBase_base: (new (...args: any[]) => {
|
|
|
63
63
|
get disposed(): boolean;
|
|
64
64
|
isLayer(): boolean;
|
|
65
65
|
isGroup(): boolean;
|
|
66
|
-
isContainer(): this is
|
|
66
|
+
isContainer(): this is Container;
|
|
67
67
|
isLine(): boolean;
|
|
68
68
|
isRoot(): boolean;
|
|
69
69
|
isRootModel(): boolean;
|
|
@@ -78,9 +78,10 @@ declare const BPMNContainerBase_base: (new (...args: any[]) => {
|
|
|
78
78
|
get(property: any): any;
|
|
79
79
|
set(props: any, propval?: any): any;
|
|
80
80
|
getState(property: any): any;
|
|
81
|
-
setState(props:
|
|
81
|
+
setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
|
|
82
82
|
get model(): any;
|
|
83
|
-
get state():
|
|
83
|
+
get state(): import("@hatiolab/things-scene").State;
|
|
84
|
+
get refid(): any;
|
|
84
85
|
get hierarchy(): any;
|
|
85
86
|
get volatile(): never[];
|
|
86
87
|
_applyProps(target: any, props: any, options: any): any;
|
|
@@ -175,7 +176,7 @@ declare const BPMNContainerBase_base: (new (...args: any[]) => {
|
|
|
175
176
|
findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
|
|
176
177
|
capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
|
|
177
178
|
findAnchor(name: string): any;
|
|
178
|
-
isDescendible(container: import("@hatiolab/things-scene").Component): boolean;
|
|
179
|
+
isDescendible(container: import("@hatiolab/things-scene").Component | any): boolean;
|
|
179
180
|
getContext(component?: unknown): any;
|
|
180
181
|
get root(): import("@hatiolab/things-scene").Component;
|
|
181
182
|
get rootModel(): import("@hatiolab/things-scene").Component;
|
|
@@ -220,9 +221,13 @@ declare const BPMNContainerBase_base: (new (...args: any[]) => {
|
|
|
220
221
|
toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
221
222
|
toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
222
223
|
toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
224
|
+
on<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback: (...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void, context?: any): any;
|
|
223
225
|
on(name: string | object, callback: Function, context?: any): any;
|
|
226
|
+
off<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback?: ((...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void) | undefined, context?: any): any;
|
|
224
227
|
off(name?: string | object, callback?: Function, context?: any): any;
|
|
228
|
+
once<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback: (...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void, context?: any): any;
|
|
225
229
|
once(name: string | object, callback: Function, context?: any): any;
|
|
230
|
+
trigger<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, ...args: import("@hatiolab/things-scene").ComponentEventMap[K]): any;
|
|
226
231
|
trigger(name: string, ...args: any[]): any;
|
|
227
232
|
delegate_on(delegator: any): any;
|
|
228
233
|
delegate_off(delegator: any): any;
|
|
@@ -255,6 +260,7 @@ declare const BPMNContainerBase_base: (new (...args: any[]) => {
|
|
|
255
260
|
set element(_v: HTMLElement | null): any;
|
|
256
261
|
}) & typeof Container;
|
|
257
262
|
export default abstract class BPMNContainerBase extends BPMNContainerBase_base {
|
|
263
|
+
createElement(): void;
|
|
258
264
|
get anchors(): Array<Anchor>;
|
|
259
265
|
get nodes(): NODE[];
|
|
260
266
|
}
|
|
@@ -58,6 +58,7 @@ function linkFilter(counterEnd) {
|
|
|
58
58
|
return !anchor?.type || anchor.type === this.type;
|
|
59
59
|
}
|
|
60
60
|
export default class BPMNContainerBase extends Connectable(Container) {
|
|
61
|
+
createElement() { }
|
|
61
62
|
get anchors() {
|
|
62
63
|
var allNodes = this.nodes;
|
|
63
64
|
var { left, top, width, height } = this.bounds;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bpmn-container-base.js","sourceRoot":"","sources":["../../src/base/bpmn-container-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,WAAW,EAAc,MAAM,wBAAwB,CAAA;AAGnF,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,uBAAU,CAAA;IACV,wBAAW,CAAA;IACX,uBAAU,CAAA;AACZ,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,KAIX;AAJD,WAAY,KAAK;IACf,kBAAS,CAAA;IACT,oBAAW,CAAA;IACX,wBAAe,CAAA;AACjB,CAAC,EAJW,KAAK,KAAL,KAAK,QAIhB;AAED,MAAM,CAAN,IAAY,IAIX;AAJD,WAAY,IAAI;IACd,2BAAmB,CAAA;IACnB,6BAAqB,CAAA;IACrB,mCAA2B,CAAA;AAC7B,CAAC,EAJW,IAAI,KAAJ,IAAI,QAIf;AAWD,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE;QACP,WAAW,EAAE,OAAO;QACpB,SAAS,EAAE,OAAO;KACnB;IACD,QAAQ,EAAE;QACR,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,eAAe;KAC1B;IACD,WAAW,EAAE;QACX,WAAW,EAAE,QAAQ;QACrB,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,OAAO;QAClB,GAAG,EAAE,MAAM;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B,YAAY,EAAE,CAAC;aAChB;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,0BAA0B;gBACvC,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,IAAI,CAAC,OAAO;gBAClB,SAAS,EAAE,SAAS,CAAC,IAAI;gBACzB,YAAY,EAAE,CAAC;aAChB;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,yBAAyB;gBACtC,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,IAAI,CAAC,OAAO;gBAClB,SAAS,EAAE,SAAS,CAAC,KAAK;gBAC1B,YAAY,EAAE,CAAC;aAChB;SACF,CAAA;IACH,CAAC;CACF","sourcesContent":["import { Anchor, Container, Connectable, Properties } from '@hatiolab/things-scene'\ntype LinkEnd = any\n\nexport enum DIRECTION {\n NORTH = 'N',\n EAST = 'E',\n SOUTH = 'S',\n WEST = 'W'\n}\n\nexport enum INOUT {\n IN = 'in',\n OUT = 'out',\n INOUT = 'inout'\n}\n\nexport enum FLOW {\n MESSAGE = 'message',\n SEQUENCE = 'sequence',\n ASSOCIATION = 'association'\n}\n\nexport type NODE = {\n name: string\n description: string\n inout: INOUT\n type: FLOW\n direction: DIRECTION\n multiplicity?: number\n}\n\nconst STYLE_MAP = {\n message: {\n strokeStyle: 'black',\n fillStyle: 'black'\n },\n sequence: {\n strokeStyle: 'red',\n fillStyle: 'red',\n lineDash: 'long-dash-dot'\n },\n association: {\n strokeStyle: 'yellow',\n fillStyle: 'yellow',\n lineDash: 'dash',\n begin: 'none',\n beginSize: 'size1',\n end: 'none',\n endSize: 'size1'\n }\n}\n\ntype FILTER_FUNCTION = (this: Anchor, counterEnd?: LinkEnd) => boolean\n\nconst ANCHOR_LENGTH = 8\n\nconst TEMPLATE = {\n type: 'bpmn-flow',\n lineWidth: 2,\n strokeStyle: 'black',\n begin: 'none',\n beginSize: 'size1',\n end: 'arrow',\n endSize: 'size9',\n round: 10\n}\n\nfunction linkFilter(this: Anchor, counterEnd?: LinkEnd) {\n if (!counterEnd) {\n return this.inout !== 'in'\n }\n\n const { component, anchor } = counterEnd || {}\n /* FIXME remove !anchor.type condition */\n return !anchor?.type || anchor.type === this.type\n}\n\nexport default abstract class BPMNContainerBase extends Connectable(Container) {\n get anchors(): Array<Anchor> {\n var allNodes = this.nodes\n var { left, top, width, height } = this.bounds\n\n var right = left + width\n var bottom = top + height\n\n const dirs: Array<Array<Anchor>> = [DIRECTION.NORTH, DIRECTION.EAST, DIRECTION.SOUTH, DIRECTION.WEST].map(\n direction => {\n const nodes = allNodes.filter(node => node.direction === direction)\n if (nodes.length === 0) {\n return []\n }\n\n var dx = 0\n var dy = 0\n var sx = 0\n var sy = 0\n\n switch (direction) {\n case DIRECTION.NORTH:\n sx = left\n sy = top\n dx = width / (nodes.length + 1)\n dy = 0\n\n break\n\n case DIRECTION.EAST:\n sx = right\n sy = top\n dx = 0\n dy = height / (nodes.length + 1)\n\n break\n\n case DIRECTION.SOUTH:\n sx = left\n sy = bottom\n dx = width / (nodes.length + 1)\n dy = 0\n\n break\n\n case DIRECTION.WEST:\n sx = left\n sy = top\n dx = 0\n dy = height / (nodes.length + 1)\n\n break\n\n default:\n }\n\n return nodes.map((node, idx) => {\n const x = sx + dx * (idx + 1)\n const y = sy + dy * (idx + 1)\n\n return {\n type: node.type as string,\n name: node.name,\n inout: node.inout,\n position: {\n x,\n y\n },\n bounds: {\n left: x - ANCHOR_LENGTH / 2,\n top: y - ANCHOR_LENGTH / 2,\n width: ANCHOR_LENGTH,\n height: ANCHOR_LENGTH\n },\n filter: linkFilter,\n template: {\n ...TEMPLATE,\n ...(STYLE_MAP[node.type || 'message'] || STYLE_MAP['message'])\n },\n multiplicity: node.multiplicity\n }\n })\n }\n )\n\n return dirs.flat()\n }\n\n get nodes(): NODE[] {\n return [\n {\n name: 'Left',\n description: 'Left side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.WEST,\n multiplicity: 1\n },\n {\n name: 'Top',\n description: 'Top side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.NORTH,\n multiplicity: 1\n },\n {\n name: 'Right',\n description: 'Right side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.EAST,\n multiplicity: 1\n },\n {\n name: 'Down',\n description: 'Down side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.SOUTH,\n multiplicity: 1\n }\n ]\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bpmn-container-base.js","sourceRoot":"","sources":["../../src/base/bpmn-container-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,WAAW,EAAc,MAAM,wBAAwB,CAAA;AAGnF,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,uBAAU,CAAA;IACV,wBAAW,CAAA;IACX,uBAAU,CAAA;AACZ,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,KAIX;AAJD,WAAY,KAAK;IACf,kBAAS,CAAA;IACT,oBAAW,CAAA;IACX,wBAAe,CAAA;AACjB,CAAC,EAJW,KAAK,KAAL,KAAK,QAIhB;AAED,MAAM,CAAN,IAAY,IAIX;AAJD,WAAY,IAAI;IACd,2BAAmB,CAAA;IACnB,6BAAqB,CAAA;IACrB,mCAA2B,CAAA;AAC7B,CAAC,EAJW,IAAI,KAAJ,IAAI,QAIf;AAWD,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE;QACP,WAAW,EAAE,OAAO;QACpB,SAAS,EAAE,OAAO;KACnB;IACD,QAAQ,EAAE;QACR,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,eAAe;KAC1B;IACD,WAAW,EAAE;QACX,WAAW,EAAE,QAAQ;QACrB,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE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AAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,IAAI,CAAC,OAAO;gBAClB,SAAS,EAAE,SAAS,CAAC,KAAK;gBAC1B,YAAY,EAAE,CAAC;aAChB;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,0BAA0B;gBACvC,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,IAAI,CAAC,OAAO;gBAClB,SAAS,EAAE,SAAS,CAAC,IAAI;gBACzB,YAAY,EAAE,CAAC;aAChB;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,yBAAyB;gBACtC,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,IAAI,CAAC,OAAO;gBAClB,SAAS,EAAE,SAAS,CAAC,KAAK;gBAC1B,YAAY,EAAE,CAAC;aAChB;SACF,CAAA;IACH,CAAC;CACF","sourcesContent":["import { Anchor, Container, Connectable, Properties } from '@hatiolab/things-scene'\ntype LinkEnd = any\n\nexport enum DIRECTION {\n NORTH = 'N',\n EAST = 'E',\n SOUTH = 'S',\n WEST = 'W'\n}\n\nexport enum INOUT {\n IN = 'in',\n OUT = 'out',\n INOUT = 'inout'\n}\n\nexport enum FLOW {\n MESSAGE = 'message',\n SEQUENCE = 'sequence',\n ASSOCIATION = 'association'\n}\n\nexport type NODE = {\n name: string\n description: string\n inout: INOUT\n type: FLOW\n direction: DIRECTION\n multiplicity?: number\n}\n\nconst STYLE_MAP = {\n message: {\n strokeStyle: 'black',\n fillStyle: 'black'\n },\n sequence: {\n strokeStyle: 'red',\n fillStyle: 'red',\n lineDash: 'long-dash-dot'\n },\n association: {\n strokeStyle: 'yellow',\n fillStyle: 'yellow',\n lineDash: 'dash',\n begin: 'none',\n beginSize: 'size1',\n end: 'none',\n endSize: 'size1'\n }\n}\n\ntype FILTER_FUNCTION = (this: Anchor, counterEnd?: LinkEnd) => boolean\n\nconst ANCHOR_LENGTH = 8\n\nconst TEMPLATE = {\n type: 'bpmn-flow',\n lineWidth: 2,\n strokeStyle: 'black',\n begin: 'none',\n beginSize: 'size1',\n end: 'arrow',\n endSize: 'size9',\n round: 10\n}\n\nfunction linkFilter(this: Anchor, counterEnd?: LinkEnd) {\n if (!counterEnd) {\n return this.inout !== 'in'\n }\n\n const { component, anchor } = counterEnd || {}\n /* FIXME remove !anchor.type condition */\n return !anchor?.type || anchor.type === this.type\n}\n\nexport default abstract class BPMNContainerBase extends Connectable(Container) {\n createElement(): void { /* inherited from Container via mixin */ }\n\n get anchors(): Array<Anchor> {\n var allNodes = this.nodes\n var { left, top, width, height } = this.bounds\n\n var right = left + width\n var bottom = top + height\n\n const dirs: Array<Array<Anchor>> = [DIRECTION.NORTH, DIRECTION.EAST, DIRECTION.SOUTH, DIRECTION.WEST].map(\n direction => {\n const nodes = allNodes.filter(node => node.direction === direction)\n if (nodes.length === 0) {\n return []\n }\n\n var dx = 0\n var dy = 0\n var sx = 0\n var sy = 0\n\n switch (direction) {\n case DIRECTION.NORTH:\n sx = left\n sy = top\n dx = width / (nodes.length + 1)\n dy = 0\n\n break\n\n case DIRECTION.EAST:\n sx = right\n sy = top\n dx = 0\n dy = height / (nodes.length + 1)\n\n break\n\n case DIRECTION.SOUTH:\n sx = left\n sy = bottom\n dx = width / (nodes.length + 1)\n dy = 0\n\n break\n\n case DIRECTION.WEST:\n sx = left\n sy = top\n dx = 0\n dy = height / (nodes.length + 1)\n\n break\n\n default:\n }\n\n return nodes.map((node, idx) => {\n const x = sx + dx * (idx + 1)\n const y = sy + dy * (idx + 1)\n\n return {\n type: node.type as string,\n name: node.name,\n inout: node.inout,\n position: {\n x,\n y\n },\n bounds: {\n left: x - ANCHOR_LENGTH / 2,\n top: y - ANCHOR_LENGTH / 2,\n width: ANCHOR_LENGTH,\n height: ANCHOR_LENGTH\n },\n filter: linkFilter,\n template: {\n ...TEMPLATE,\n ...(STYLE_MAP[node.type || 'message'] || STYLE_MAP['message'])\n },\n multiplicity: node.multiplicity\n }\n })\n }\n )\n\n return dirs.flat()\n }\n\n get nodes(): NODE[] {\n return [\n {\n name: 'Left',\n description: 'Left side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.WEST,\n multiplicity: 1\n },\n {\n name: 'Top',\n description: 'Top side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.NORTH,\n multiplicity: 1\n },\n {\n name: 'Right',\n description: 'Right side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.EAST,\n multiplicity: 1\n },\n {\n name: 'Down',\n description: 'Down side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.SOUTH,\n multiplicity: 1\n }\n ]\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Anchor, BOUNDS,
|
|
1
|
+
import { Anchor, BOUNDS, Shape } from '@hatiolab/things-scene';
|
|
2
2
|
export declare enum DIRECTION {
|
|
3
3
|
NORTH = "N",
|
|
4
4
|
EAST = "E",
|
|
@@ -63,7 +63,7 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
63
63
|
get disposed(): boolean;
|
|
64
64
|
isLayer(): boolean;
|
|
65
65
|
isGroup(): boolean;
|
|
66
|
-
isContainer(): this is import("@hatiolab/things-scene
|
|
66
|
+
isContainer(): this is import("@hatiolab/things-scene").Container;
|
|
67
67
|
isLine(): boolean;
|
|
68
68
|
isRoot(): boolean;
|
|
69
69
|
isRootModel(): boolean;
|
|
@@ -78,9 +78,10 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
78
78
|
get(property: any): any;
|
|
79
79
|
set(props: any, propval?: any): any;
|
|
80
80
|
getState(property: any): any;
|
|
81
|
-
setState(props:
|
|
81
|
+
setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
|
|
82
82
|
get model(): any;
|
|
83
|
-
get state():
|
|
83
|
+
get state(): import("@hatiolab/things-scene").State;
|
|
84
|
+
get refid(): any;
|
|
84
85
|
get hierarchy(): any;
|
|
85
86
|
get volatile(): never[];
|
|
86
87
|
_applyProps(target: any, props: any, options: any): any;
|
|
@@ -120,7 +121,7 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
120
121
|
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
121
122
|
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
122
123
|
render(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
123
|
-
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
124
|
+
prepare(resolve: (component: import("@hatiolab/things-scene").Component) => void, reject: (reason: any) => void): void;
|
|
124
125
|
prepareIf(condition: boolean): void;
|
|
125
126
|
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
126
127
|
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
@@ -171,16 +172,16 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
171
172
|
get started(): boolean;
|
|
172
173
|
set started(v: boolean): any;
|
|
173
174
|
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
174
|
-
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
|
|
175
|
-
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
|
|
176
|
-
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
175
|
+
findFirst(finder: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): import("@hatiolab/things-scene").Component | undefined;
|
|
176
|
+
findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
|
|
177
|
+
capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
|
|
177
178
|
findAnchor(name: string): any;
|
|
178
|
-
isDescendible(container: Component): boolean;
|
|
179
|
+
isDescendible(container: import("@hatiolab/things-scene").Component | any): boolean;
|
|
179
180
|
getContext(component?: unknown): any;
|
|
180
|
-
get root(): Component;
|
|
181
|
-
get rootModel(): Component;
|
|
182
|
-
get parent(): Component;
|
|
183
|
-
set parent(v: Component): any;
|
|
181
|
+
get root(): import("@hatiolab/things-scene").Component;
|
|
182
|
+
get rootModel(): import("@hatiolab/things-scene").Component;
|
|
183
|
+
get parent(): import("@hatiolab/things-scene").Component;
|
|
184
|
+
set parent(v: import("@hatiolab/things-scene").Component): any;
|
|
184
185
|
get anchors(): import("@hatiolab/things-scene").Anchor[];
|
|
185
186
|
get scalable(): boolean;
|
|
186
187
|
get stuck(): boolean;
|
|
@@ -206,47 +207,51 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
206
207
|
ondropfile(transfered: FileList, files: string[]): void;
|
|
207
208
|
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
208
209
|
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
209
|
-
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
210
|
-
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
211
|
-
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
212
|
-
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
213
|
-
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
214
|
-
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
215
|
-
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
210
|
+
transcoordS2T(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
211
|
+
transcoordT2P(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
212
|
+
transcoordT2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
213
|
+
transcoordS2TR(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
214
|
+
transcoordS2O(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
215
|
+
transcoordC2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
216
|
+
transcoordS2C(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
216
217
|
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
217
218
|
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
218
|
-
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
219
|
-
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
220
|
-
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
221
|
-
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
222
|
-
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
219
|
+
toScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
220
|
+
fromScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
221
|
+
toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
222
|
+
toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
223
|
+
toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
224
|
+
on<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback: (...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void, context?: any): any;
|
|
223
225
|
on(name: string | object, callback: Function, context?: any): any;
|
|
226
|
+
off<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback?: ((...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void) | undefined, context?: any): any;
|
|
224
227
|
off(name?: string | object, callback?: Function, context?: any): any;
|
|
228
|
+
once<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback: (...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void, context?: any): any;
|
|
225
229
|
once(name: string | object, callback: Function, context?: any): any;
|
|
230
|
+
trigger<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, ...args: import("@hatiolab/things-scene").ComponentEventMap[K]): any;
|
|
226
231
|
trigger(name: string, ...args: any[]): any;
|
|
227
232
|
delegate_on(delegator: any): any;
|
|
228
233
|
delegate_off(delegator: any): any;
|
|
229
234
|
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
230
235
|
calculateBounds?(): void;
|
|
231
236
|
oncreate_element?(element: HTMLElement): void;
|
|
232
|
-
removeComponent(component: Component, ghost?: boolean): void;
|
|
233
|
-
addComponent(component: Component, ghost?: boolean): void;
|
|
234
|
-
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
235
|
-
getOverlay(component: Component): HTMLElement | undefined;
|
|
236
|
-
findById(id: string): Component | undefined;
|
|
237
|
-
findByRefid(ref: string | number): Component | undefined;
|
|
238
|
-
findAllById(id: string): Component[];
|
|
237
|
+
removeComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
238
|
+
addComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
239
|
+
insertComponentAt(component: import("@hatiolab/things-scene").Component, index: number, ghost?: boolean): void;
|
|
240
|
+
getOverlay(component: import("@hatiolab/things-scene").Component): HTMLElement | undefined;
|
|
241
|
+
findById(id: string): import("@hatiolab/things-scene").Component | undefined;
|
|
242
|
+
findByRefid(ref: string | number): import("@hatiolab/things-scene").Component | undefined;
|
|
243
|
+
findAllById(id: string): import("@hatiolab/things-scene").Component[];
|
|
239
244
|
resize(): void;
|
|
240
245
|
fit(type?: string): void;
|
|
241
|
-
get components(): Component[] | undefined;
|
|
246
|
+
get components(): import("@hatiolab/things-scene").Component[] | undefined;
|
|
242
247
|
get layout(): any;
|
|
243
248
|
get auxOverlay(): HTMLElement | undefined;
|
|
244
249
|
get isReady(): boolean;
|
|
245
250
|
get unitScale(): number;
|
|
246
|
-
get selected(): Component[];
|
|
247
|
-
set selected(_v: Component[]): any;
|
|
248
|
-
get focused(): Component | null;
|
|
249
|
-
set focused(_v: Component | null): any;
|
|
251
|
+
get selected(): import("@hatiolab/things-scene").Component[];
|
|
252
|
+
set selected(_v: import("@hatiolab/things-scene").Component[]): any;
|
|
253
|
+
get focused(): import("@hatiolab/things-scene").Component | null;
|
|
254
|
+
set focused(_v: import("@hatiolab/things-scene").Component | null): any;
|
|
250
255
|
get hasSameParentForAllSelected(): boolean;
|
|
251
256
|
set hasSameParentForAllSelected(_v: boolean): any;
|
|
252
257
|
get fitMode(): string | undefined;
|
|
@@ -303,7 +308,7 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
303
308
|
get disposed(): boolean;
|
|
304
309
|
isLayer(): boolean;
|
|
305
310
|
isGroup(): boolean;
|
|
306
|
-
isContainer(): this is import("@hatiolab/things-scene
|
|
311
|
+
isContainer(): this is import("@hatiolab/things-scene").Container;
|
|
307
312
|
isLine(): boolean;
|
|
308
313
|
isRoot(): boolean;
|
|
309
314
|
isRootModel(): boolean;
|
|
@@ -319,9 +324,10 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
319
324
|
get(property: any): any;
|
|
320
325
|
set(props: any, propval?: any): any;
|
|
321
326
|
getState(property: any): any;
|
|
322
|
-
setState(props:
|
|
327
|
+
setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
|
|
323
328
|
get model(): any;
|
|
324
|
-
get state():
|
|
329
|
+
get state(): import("@hatiolab/things-scene").State;
|
|
330
|
+
get refid(): any;
|
|
325
331
|
get hierarchy(): any;
|
|
326
332
|
get volatile(): never[];
|
|
327
333
|
_applyProps(target: any, props: any, options: any): any;
|
|
@@ -357,7 +363,7 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
357
363
|
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
358
364
|
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
359
365
|
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
360
|
-
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
366
|
+
prepare(resolve: (component: import("@hatiolab/things-scene").Component) => void, reject: (reason: any) => void): void;
|
|
361
367
|
prepareIf(condition: boolean): void;
|
|
362
368
|
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
363
369
|
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
@@ -408,16 +414,16 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
408
414
|
get started(): boolean;
|
|
409
415
|
set started(v: boolean): any;
|
|
410
416
|
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
411
|
-
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
|
|
412
|
-
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
|
|
413
|
-
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
417
|
+
findFirst(finder: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): import("@hatiolab/things-scene").Component | undefined;
|
|
418
|
+
findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
|
|
419
|
+
capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
|
|
414
420
|
findAnchor(name: string): any;
|
|
415
|
-
isDescendible(container: Component): boolean;
|
|
421
|
+
isDescendible(container: import("@hatiolab/things-scene").Component | any): boolean;
|
|
416
422
|
getContext(component?: unknown): any;
|
|
417
|
-
get root(): Component;
|
|
418
|
-
get rootModel(): Component;
|
|
419
|
-
get parent(): Component;
|
|
420
|
-
set parent(v: Component): any;
|
|
423
|
+
get root(): import("@hatiolab/things-scene").Component;
|
|
424
|
+
get rootModel(): import("@hatiolab/things-scene").Component;
|
|
425
|
+
get parent(): import("@hatiolab/things-scene").Component;
|
|
426
|
+
set parent(v: import("@hatiolab/things-scene").Component): any;
|
|
421
427
|
get scalable(): boolean;
|
|
422
428
|
get stuck(): boolean;
|
|
423
429
|
get capturable(): boolean;
|
|
@@ -442,47 +448,51 @@ declare const BPMNControlBase_base: (new (...args: any[]) => {
|
|
|
442
448
|
ondropfile(transfered: FileList, files: string[]): void;
|
|
443
449
|
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
444
450
|
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
445
|
-
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
446
|
-
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
447
|
-
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
448
|
-
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
449
|
-
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
450
|
-
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
451
|
-
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
451
|
+
transcoordS2T(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
452
|
+
transcoordT2P(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
453
|
+
transcoordT2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
454
|
+
transcoordS2TR(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
455
|
+
transcoordS2O(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
456
|
+
transcoordC2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
457
|
+
transcoordS2C(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
452
458
|
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
453
459
|
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
454
|
-
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
455
|
-
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
456
|
-
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
457
|
-
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
458
|
-
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
460
|
+
toScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
461
|
+
fromScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
462
|
+
toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
463
|
+
toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
464
|
+
toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
465
|
+
on<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback: (...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void, context?: any): any;
|
|
459
466
|
on(name: string | object, callback: Function, context?: any): any;
|
|
467
|
+
off<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback?: ((...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void) | undefined, context?: any): any;
|
|
460
468
|
off(name?: string | object, callback?: Function, context?: any): any;
|
|
469
|
+
once<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback: (...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void, context?: any): any;
|
|
461
470
|
once(name: string | object, callback: Function, context?: any): any;
|
|
471
|
+
trigger<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, ...args: import("@hatiolab/things-scene").ComponentEventMap[K]): any;
|
|
462
472
|
trigger(name: string, ...args: any[]): any;
|
|
463
473
|
delegate_on(delegator: any): any;
|
|
464
474
|
delegate_off(delegator: any): any;
|
|
465
475
|
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
466
476
|
calculateBounds?(): void;
|
|
467
477
|
oncreate_element?(element: HTMLElement): void;
|
|
468
|
-
removeComponent(component: Component, ghost?: boolean): void;
|
|
469
|
-
addComponent(component: Component, ghost?: boolean): void;
|
|
470
|
-
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
471
|
-
getOverlay(component: Component): HTMLElement | undefined;
|
|
472
|
-
findById(id: string): Component | undefined;
|
|
473
|
-
findByRefid(ref: string | number): Component | undefined;
|
|
474
|
-
findAllById(id: string): Component[];
|
|
478
|
+
removeComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
479
|
+
addComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
480
|
+
insertComponentAt(component: import("@hatiolab/things-scene").Component, index: number, ghost?: boolean): void;
|
|
481
|
+
getOverlay(component: import("@hatiolab/things-scene").Component): HTMLElement | undefined;
|
|
482
|
+
findById(id: string): import("@hatiolab/things-scene").Component | undefined;
|
|
483
|
+
findByRefid(ref: string | number): import("@hatiolab/things-scene").Component | undefined;
|
|
484
|
+
findAllById(id: string): import("@hatiolab/things-scene").Component[];
|
|
475
485
|
resize(): void;
|
|
476
486
|
fit(type?: string): void;
|
|
477
|
-
get components(): Component[] | undefined;
|
|
487
|
+
get components(): import("@hatiolab/things-scene").Component[] | undefined;
|
|
478
488
|
get layout(): any;
|
|
479
489
|
get auxOverlay(): HTMLElement | undefined;
|
|
480
490
|
get isReady(): boolean;
|
|
481
491
|
get unitScale(): number;
|
|
482
|
-
get selected(): Component[];
|
|
483
|
-
set selected(_v: Component[]): any;
|
|
484
|
-
get focused(): Component | null;
|
|
485
|
-
set focused(_v: Component | null): any;
|
|
492
|
+
get selected(): import("@hatiolab/things-scene").Component[];
|
|
493
|
+
set selected(_v: import("@hatiolab/things-scene").Component[]): any;
|
|
494
|
+
get focused(): import("@hatiolab/things-scene").Component | null;
|
|
495
|
+
set focused(_v: import("@hatiolab/things-scene").Component | null): any;
|
|
486
496
|
get hasSameParentForAllSelected(): boolean;
|
|
487
497
|
set hasSameParentForAllSelected(_v: boolean): any;
|
|
488
498
|
get fitMode(): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bpmn-control-base.js","sourceRoot":"","sources":["../../src/base/bpmn-control-base.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"bpmn-control-base.js","sourceRoot":"","sources":["../../src/base/bpmn-control-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAGjG,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,uBAAU,CAAA;IACV,wBAAW,CAAA;I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atiolab/things-scene'\ntype LinkEnd = any\n\nexport enum DIRECTION {\n NORTH = 'N',\n EAST = 'E',\n SOUTH = 'S',\n WEST = 'W'\n}\n\nexport enum INOUT {\n IN = 'in',\n OUT = 'out',\n INOUT = 'inout'\n}\n\nexport enum FLOW {\n MESSAGE = 'message',\n SEQUENCE = 'sequence',\n ASSOCIATION = 'association'\n}\n\nexport type NODE = {\n name: string\n description: string\n inout: INOUT\n type: FLOW\n direction: DIRECTION\n multiplicity?: number\n}\n\nconst STYLE_MAP = {\n message: {\n strokeStyle: 'black',\n fillStyle: 'black'\n },\n sequence: {\n strokeStyle: 'red',\n fillStyle: 'red',\n lineDash: 'long-dash-dot'\n },\n association: {\n strokeStyle: 'yellow',\n fillStyle: 'yellow',\n lineDash: 'dash',\n begin: 'none',\n beginSize: 'size1',\n end: 'none',\n endSize: 'size1'\n }\n}\n\ntype FILTER_FUNCTION = (this: Anchor, counterEnd?: LinkEnd) => boolean\n\nconst ANCHOR_LENGTH = 8\n\nconst TEMPLATE = {\n type: 'bpmn-flow',\n lineWidth: 2,\n strokeStyle: 'black',\n begin: 'none',\n beginSize: 'size1',\n end: 'arrow',\n endSize: 'size9',\n round: 10\n}\n\nfunction linkFilter(this: Anchor, counterEnd?: LinkEnd) {\n if (!counterEnd) {\n return this.inout !== 'in'\n }\n\n const { component, anchor } = counterEnd || {}\n /* FIXME remove !anchor.type condition */\n return !anchor?.type || anchor.type === this.type\n}\n\nexport default abstract class BPMNControlBase extends Connectable(RectPath(Shape)) {\n get anchors(): Array<Anchor> {\n var allNodes = this.nodes\n var { left, top, width, height } = this.bounds\n\n var right = left + width\n var bottom = top + height\n\n const dirs: Array<Array<Anchor>> = [DIRECTION.NORTH, DIRECTION.EAST, DIRECTION.SOUTH, DIRECTION.WEST].map(\n direction => {\n const nodes = allNodes.filter(node => node.direction === direction)\n if (nodes.length === 0) {\n return []\n }\n\n var dx = 0\n var dy = 0\n var sx = 0\n var sy = 0\n\n switch (direction) {\n case DIRECTION.NORTH:\n sx = left\n sy = top\n dx = width / (nodes.length + 1)\n dy = 0\n\n break\n\n case DIRECTION.EAST:\n sx = right\n sy = top\n dx = 0\n dy = height / (nodes.length + 1)\n\n break\n\n case DIRECTION.SOUTH:\n sx = left\n sy = bottom\n dx = width / (nodes.length + 1)\n dy = 0\n\n break\n\n case DIRECTION.WEST:\n sx = left\n sy = top\n dx = 0\n dy = height / (nodes.length + 1)\n\n break\n\n default:\n }\n\n return nodes.map((node, idx) => {\n const x = sx + dx * (idx + 1)\n const y = sy + dy * (idx + 1)\n\n return {\n type: node.type as string,\n name: node.name,\n inout: node.inout,\n position: {\n x,\n y\n },\n bounds: {\n left: x - ANCHOR_LENGTH / 2,\n top: y - ANCHOR_LENGTH / 2,\n width: ANCHOR_LENGTH,\n height: ANCHOR_LENGTH\n },\n filter: linkFilter,\n template: {\n ...TEMPLATE,\n ...(STYLE_MAP[node.type || 'message'] || STYLE_MAP['message'])\n },\n multiplicity: node.multiplicity\n }\n })\n }\n )\n\n return dirs.flat()\n }\n\n get nodes(): NODE[] {\n return [\n {\n name: 'Left',\n description: 'Left side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.WEST,\n multiplicity: 1\n },\n {\n name: 'Top',\n description: 'Top side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.NORTH,\n multiplicity: 1\n },\n {\n name: 'Right',\n description: 'Right side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.EAST,\n multiplicity: 1\n },\n {\n name: 'Down',\n description: 'Down side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.SOUTH,\n multiplicity: 1\n }\n ]\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/scene-bpmn",
|
|
3
3
|
"description": "bpmn components for things-scene",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.0.0-beta.
|
|
5
|
+
"version": "10.0.0-beta.65",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
36
|
-
"@things-factory/builder": "^10.0.0-
|
|
37
|
-
"@things-factory/operato-board": "^10.0.0-
|
|
36
|
+
"@things-factory/builder": "^10.0.0-zeta.1",
|
|
37
|
+
"@things-factory/operato-board": "^10.0.0-zeta.1",
|
|
38
38
|
"@types/lodash-es": "^4.17.5",
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
40
40
|
"@typescript-eslint/parser": "^8.0.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"prettier --write"
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "99733bf39e2d279630d68844f19d9687272a4992"
|
|
64
64
|
}
|