@wcardinal/wcardinal-ui 0.181.0 → 0.182.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.
@@ -27,12 +27,4 @@ export declare type DDiagramBaseControllerOpenType = number;
27
27
  export interface DDiagramBaseController {
28
28
  piece: DDiagramBasePieceController;
29
29
  getByName(name: string): Promise<DDiagramSerializedSimple | DDiagramSerialized>;
30
- /**
31
- * Opens a diagram or a page.
32
- *
33
- * @param type a diagram or a page
34
- * @param id an id to identify a diagram or a page
35
- * @param inNewWindow true to open in a new window
36
- */
37
- open?(type: DDiagramBaseControllerOpenType, id: string, inNewWindow: boolean): void;
38
30
  }
@@ -0,0 +1,2 @@
1
+ export declare type EShapeActionOpenOpener = (target: string, inNewWindow: boolean) => void;
2
+ export declare const EShapeActionOpenOpeners: Record<number, EShapeActionOpenOpener>;
@@ -1 +1 @@
1
- {"version":3,"file":"d-diagram-base-controller.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-base-controller.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;GAEG;AACH,MAAM,CAAC,IAAM,8BAA8B,GAAG;IAC7C,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,SAAS,EAAE,IAAI;CACN,CAAC","sourcesContent":["/**\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramSerialized, DDiagramSerializedSimple } from \"./d-diagram-serialized\";\n\n/**\n * {@link DDiagram} piece controller.\n */\nexport interface DDiagramBasePieceController {\n\tgetByName(name: string): Promise<DDiagramSerializedSimple | DDiagramSerialized>;\n}\n\n/**\n * {@link DDiagram} controller open type.\n */\nexport const DDiagramBaseControllerOpenType = {\n\tDIAGRAM: 0,\n\tPAGE: 1,\n\tEXTENSION: 1000\n} as const;\n\n/**\n * {@link DDiagram} controller open type.\n */\nexport type DDiagramBaseControllerOpenType = number;\n\n/**\n * {@link DDiagram} controller.\n */\nexport interface DDiagramBaseController {\n\tpiece: DDiagramBasePieceController;\n\tgetByName(name: string): Promise<DDiagramSerializedSimple | DDiagramSerialized>;\n\n\t/**\n\t * Opens a diagram or a page.\n\t *\n\t * @param type a diagram or a page\n\t * @param id an id to identify a diagram or a page\n\t * @param inNewWindow true to open in a new window\n\t */\n\topen?(type: DDiagramBaseControllerOpenType, id: string, inNewWindow: boolean): void;\n}\n"]}
1
+ {"version":3,"file":"d-diagram-base-controller.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-base-controller.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;GAEG;AACH,MAAM,CAAC,IAAM,8BAA8B,GAAG;IAC7C,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,SAAS,EAAE,IAAI;CACN,CAAC","sourcesContent":["/**\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramSerialized, DDiagramSerializedSimple } from \"./d-diagram-serialized\";\n\n/**\n * {@link DDiagram} piece controller.\n */\nexport interface DDiagramBasePieceController {\n\tgetByName(name: string): Promise<DDiagramSerializedSimple | DDiagramSerialized>;\n}\n\n/**\n * {@link DDiagram} controller open type.\n */\nexport const DDiagramBaseControllerOpenType = {\n\tDIAGRAM: 0,\n\tPAGE: 1,\n\tEXTENSION: 1000\n} as const;\n\n/**\n * {@link DDiagram} controller open type.\n */\nexport type DDiagramBaseControllerOpenType = number;\n\n/**\n * {@link DDiagram} controller.\n */\nexport interface DDiagramBaseController {\n\tpiece: DDiagramBasePieceController;\n\tgetByName(name: string): Promise<DDiagramSerializedSimple | DDiagramSerialized>;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (C) 2019 Toshiba Corporation
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ export var EShapeActionOpenOpeners = {};
6
+ //# sourceMappingURL=e-shape-action-open-opener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e-shape-action-open-opener.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-open-opener.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,IAAM,uBAAuB,GAA2C,EAAE,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type EShapeActionOpenOpener = (target: string, inNewWindow: boolean) => void;\n\nexport const EShapeActionOpenOpeners: Record<number, EShapeActionOpenOpener> = {};\n"]}
@@ -8,6 +8,7 @@ import { DDiagramBaseControllerOpenType } from "../../d-diagram-base-controller"
8
8
  import { DDiagrams } from "../../d-diagrams";
9
9
  import { EShapeType } from "../e-shape-type";
10
10
  import { EShapeBase } from "../variant/e-shape-base";
11
+ import { EShapeActionOpenOpeners } from "./e-shape-action-open-opener";
11
12
  var EShapeActionRuntimes = /** @class */ (function () {
12
13
  function EShapeActionRuntimes() {
13
14
  }
@@ -28,30 +29,31 @@ var EShapeActionRuntimes = /** @class */ (function () {
28
29
  return null;
29
30
  };
30
31
  EShapeActionRuntimes.open = function (shape, type, target, inNewWindow) {
31
- var container = this.toContainer(shape);
32
- if (container) {
33
- var controller = container.controller;
34
- if (controller) {
35
- if (controller.open != null) {
36
- controller.open(type, target, inNewWindow);
37
- }
38
- else {
39
- switch (type) {
40
- case DDiagramBaseControllerOpenType.DIAGRAM:
32
+ var opener = EShapeActionOpenOpeners[type];
33
+ if (opener != null) {
34
+ opener(target, inNewWindow);
35
+ }
36
+ else {
37
+ switch (type) {
38
+ case DDiagramBaseControllerOpenType.DIAGRAM:
39
+ var container_1 = this.toContainer(shape);
40
+ if (container_1) {
41
+ var controller = container_1.controller;
42
+ if (controller) {
41
43
  controller.getByName(target).then(function (found) {
42
- container.set(DDiagrams.toSerialized(found));
44
+ container_1.set(DDiagrams.toSerialized(found));
43
45
  });
44
- break;
45
- case DDiagramBaseControllerOpenType.PAGE:
46
- if (inNewWindow) {
47
- window.open(target);
48
- }
49
- else {
50
- window.location.href = target;
51
- }
52
- break;
46
+ }
53
47
  }
54
- }
48
+ break;
49
+ case DDiagramBaseControllerOpenType.PAGE:
50
+ if (inNewWindow) {
51
+ window.open(target);
52
+ }
53
+ else {
54
+ window.location.href = target;
55
+ }
56
+ break;
55
57
  }
56
58
  }
57
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-action-runtimes.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-runtimes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAEN,8BAA8B,EAC9B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAgCrD;IAAA;IA+GA,CAAC;IA9GO,gCAAW,GAAlB,UAAmB,MAAe;QACjC,OAAO,MAAM,IAAI,IAAI,IAAI,MAAM,YAAY,gBAAgB,CAAC;IAC7D,CAAC;IAEM,+BAAU,GAAjB,UAAkB,MAAe;QAChC,OAAO,CACN,MAAM,IAAI,IAAI,IAAI,MAAM,YAAY,UAAU,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,QAAQ,CACrF,CAAC;IACH,CAAC;IAEM,gCAAW,GAAlB,UAAmB,KAAqB;QACvC,IAAI,OAAO,GAAuC,KAAK,CAAC;QACxD,OAAO,OAAO,IAAI,IAAI,EAAE;YACvB,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;gBAC9B,OAAO,OAAO,CAAC;aACf;YACD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;SACz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,IAAI,EAAE,KAAK,CAAC,CAAC;YACxB,IAAI,SAAS,EAAE;gBACd,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aAClC;SACD;aAAM;YACN,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;YACrC,IAAI,SAAS,EAAE;gBACd,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;aAC/C;SACD;IACF,CAAC;IACF,2BAAC;AAAD,CAAC,AA/GD,IA+GC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DApplications } from \"../../d-applications\";\nimport { DCanvasContainer } from \"../../d-canvas-container\";\nimport {\n\tDDiagramBaseController,\n\tDDiagramBaseControllerOpenType\n} from \"../../d-diagram-base-controller\";\nimport { DDiagramSerialized } from \"../../d-diagram-serialized\";\nimport { DDiagrams } from \"../../d-diagrams\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeType } from \"../e-shape-type\";\nimport { EShapeBase } from \"../variant/e-shape-base\";\n\nexport interface EShapeActionRuntimeContainerDataScoped {\n\tset(id: string, value: unknown, time: number): boolean;\n}\n\nexport interface EShapeActionRuntimeContainerData {\n\treadonly remote: EShapeActionRuntimeContainerDataScoped;\n\treadonly private: EShapeActionRuntimeContainerDataScoped;\n\treadonly protected: EShapeActionRuntimeContainerDataScoped;\n\n\tset(\n\t\tid: string,\n\t\tvalue: unknown,\n\t\ttime?: number,\n\t\tfrom?: number | null,\n\t\tto?: number | null\n\t): boolean;\n}\n\nexport interface EShapeActionRuntimeContainerShape {\n\temit(name: string, ...args: unknown[]): void;\n}\n\nexport interface EShapeActionRuntimeContainer extends DCanvasContainer {\n\treadonly shape: EShapeActionRuntimeContainerShape;\n\treadonly data: EShapeActionRuntimeContainerData;\n\treadonly controller: DDiagramBaseController | null;\n\n\tset(serialized: DDiagramSerialized | null): void;\n}\n\nexport class EShapeActionRuntimes {\n\tstatic isContainer(target: unknown): target is EShapeActionRuntimeContainer {\n\t\treturn target != null && target instanceof DCanvasContainer;\n\t}\n\n\tstatic isEmbedded(target: unknown): target is EShape {\n\t\treturn (\n\t\t\ttarget != null && target instanceof EShapeBase && target.type === EShapeType.EMBEDDED\n\t\t);\n\t}\n\n\tstatic toContainer(shape?: EShape | null): EShapeActionRuntimeContainer | null {\n\t\tlet current: { parent: any } | null | undefined = shape;\n\t\twhile (current != null) {\n\t\t\tif (this.isContainer(current)) {\n\t\t\t\treturn current;\n\t\t\t}\n\t\t\tcurrent = current.parent;\n\t\t}\n\t\treturn null;\n\t}\n\n\tstatic open(\n\t\tshape: EShape,\n\t\ttype: DDiagramBaseControllerOpenType,\n\t\ttarget: string,\n\t\tinNewWindow: boolean\n\t): void {\n\t\tconst container = this.toContainer(shape);\n\t\tif (container) {\n\t\t\tconst controller = container.controller;\n\t\t\tif (controller) {\n\t\t\t\tif (controller.open != null) {\n\t\t\t\t\tcontroller.open(type, target, inNewWindow);\n\t\t\t\t} else {\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase DDiagramBaseControllerOpenType.DIAGRAM:\n\t\t\t\t\t\t\tcontroller.getByName(target).then((found): void => {\n\t\t\t\t\t\t\t\tcontainer.set(DDiagrams.toSerialized(found));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DDiagramBaseControllerOpenType.PAGE:\n\t\t\t\t\t\t\tif (inNewWindow) {\n\t\t\t\t\t\t\t\twindow.open(target);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twindow.location.href = target;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic write(\n\t\tshape: EShape,\n\t\tid: string,\n\t\tvalue: unknown,\n\t\ttime: number,\n\t\tremote: boolean\n\t): boolean {\n\t\tif (remote) {\n\t\t\tconst container = this.toContainer(shape);\n\t\t\tif (container) {\n\t\t\t\treturn container.data.remote.set(id, value, time);\n\t\t\t}\n\t\t} else {\n\t\t\tlet current: { parent: any } | null | undefined = shape;\n\t\t\twhile (current != null) {\n\t\t\t\tif (this.isContainer(current)) {\n\t\t\t\t\tif (current.data.private.set(id, value, time)) {\n\t\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (current.data.protected.set(id, value, time)) {\n\t\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (current.data.set(id, value, time)) {\n\t\t\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (this.isEmbedded(current)) {\n\t\t\t\t\tif (current.data.getPrivate()?.set(id, value, time)) {\n\t\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrent = current.parent;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tstatic emit(shape: EShape, name: string): void;\n\tstatic emit(shape: EShape, name: string, value: unknown, time: number): void;\n\tstatic emit(shape: EShape, name: string, value?: unknown, time?: number): void {\n\t\tconst container = EShapeActionRuntimes.toContainer(shape);\n\t\tif (time === undefined) {\n\t\t\tshape.emit(name, shape);\n\t\t\tif (container) {\n\t\t\t\tcontainer.shape.emit(name, shape);\n\t\t\t}\n\t\t} else {\n\t\t\tshape.emit(name, value, time, shape);\n\t\t\tif (container) {\n\t\t\t\tcontainer.shape.emit(name, value, time, shape);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-action-runtimes.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardin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EAAE;gBACd,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;aAC/C;SACD;IACF,CAAC;IACF,2BAAC;AAAD,CAAC,AAhHD,IAgHC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DApplications } from \"../../d-applications\";\nimport { DCanvasContainer } from \"../../d-canvas-container\";\nimport {\n\tDDiagramBaseController,\n\tDDiagramBaseControllerOpenType\n} from \"../../d-diagram-base-controller\";\nimport { DDiagramSerialized } from \"../../d-diagram-serialized\";\nimport { DDiagrams } from \"../../d-diagrams\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeType } from \"../e-shape-type\";\nimport { EShapeBase } from \"../variant/e-shape-base\";\nimport { EShapeActionOpenOpeners } from \"./e-shape-action-open-opener\";\n\nexport interface EShapeActionRuntimeContainerDataScoped {\n\tset(id: string, value: unknown, time: number): boolean;\n}\n\nexport interface EShapeActionRuntimeContainerData {\n\treadonly remote: EShapeActionRuntimeContainerDataScoped;\n\treadonly private: EShapeActionRuntimeContainerDataScoped;\n\treadonly protected: EShapeActionRuntimeContainerDataScoped;\n\n\tset(\n\t\tid: string,\n\t\tvalue: unknown,\n\t\ttime?: number,\n\t\tfrom?: number | null,\n\t\tto?: number | null\n\t): boolean;\n}\n\nexport interface EShapeActionRuntimeContainerShape {\n\temit(name: string, ...args: unknown[]): void;\n}\n\nexport interface EShapeActionRuntimeContainer extends DCanvasContainer {\n\treadonly shape: EShapeActionRuntimeContainerShape;\n\treadonly data: EShapeActionRuntimeContainerData;\n\treadonly controller: DDiagramBaseController | null;\n\n\tset(serialized: DDiagramSerialized | null): void;\n}\n\nexport class EShapeActionRuntimes {\n\tstatic isContainer(target: unknown): target is EShapeActionRuntimeContainer {\n\t\treturn target != null && target instanceof DCanvasContainer;\n\t}\n\n\tstatic isEmbedded(target: unknown): target is EShape {\n\t\treturn (\n\t\t\ttarget != null && target instanceof EShapeBase && target.type === EShapeType.EMBEDDED\n\t\t);\n\t}\n\n\tstatic toContainer(shape?: EShape | null): EShapeActionRuntimeContainer | null {\n\t\tlet current: { parent: any } | null | undefined = shape;\n\t\twhile (current != null) {\n\t\t\tif (this.isContainer(current)) {\n\t\t\t\treturn current;\n\t\t\t}\n\t\t\tcurrent = current.parent;\n\t\t}\n\t\treturn null;\n\t}\n\n\tstatic open(\n\t\tshape: EShape,\n\t\ttype: DDiagramBaseControllerOpenType,\n\t\ttarget: string,\n\t\tinNewWindow: boolean\n\t): void {\n\t\tconst opener = EShapeActionOpenOpeners[type];\n\t\tif (opener != null) {\n\t\t\topener(target, inNewWindow);\n\t\t} else {\n\t\t\tswitch (type) {\n\t\t\t\tcase DDiagramBaseControllerOpenType.DIAGRAM:\n\t\t\t\t\tconst container = this.toContainer(shape);\n\t\t\t\t\tif (container) {\n\t\t\t\t\t\tconst controller = container.controller;\n\t\t\t\t\t\tif (controller) {\n\t\t\t\t\t\t\tcontroller.getByName(target).then((found): void => {\n\t\t\t\t\t\t\t\tcontainer.set(DDiagrams.toSerialized(found));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DDiagramBaseControllerOpenType.PAGE:\n\t\t\t\t\tif (inNewWindow) {\n\t\t\t\t\t\twindow.open(target);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twindow.location.href = target;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic write(\n\t\tshape: EShape,\n\t\tid: string,\n\t\tvalue: unknown,\n\t\ttime: number,\n\t\tremote: boolean\n\t): boolean {\n\t\tif (remote) {\n\t\t\tconst container = this.toContainer(shape);\n\t\t\tif (container) {\n\t\t\t\treturn container.data.remote.set(id, value, time);\n\t\t\t}\n\t\t} else {\n\t\t\tlet current: { parent: any } | null | undefined = shape;\n\t\t\twhile (current != null) {\n\t\t\t\tif (this.isContainer(current)) {\n\t\t\t\t\tif (current.data.private.set(id, value, time)) {\n\t\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (current.data.protected.set(id, value, time)) {\n\t\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (current.data.set(id, value, time)) {\n\t\t\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (this.isEmbedded(current)) {\n\t\t\t\t\tif (current.data.getPrivate()?.set(id, value, time)) {\n\t\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrent = current.parent;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tstatic emit(shape: EShape, name: string): void;\n\tstatic emit(shape: EShape, name: string, value: unknown, time: number): void;\n\tstatic emit(shape: EShape, name: string, value?: unknown, time?: number): void {\n\t\tconst container = EShapeActionRuntimes.toContainer(shape);\n\t\tif (time === undefined) {\n\t\t\tshape.emit(name, shape);\n\t\t\tif (container) {\n\t\t\t\tcontainer.shape.emit(name, shape);\n\t\t\t}\n\t\t} else {\n\t\t\tshape.emit(name, value, time, shape);\n\t\t\tif (container) {\n\t\t\t\tcontainer.shape.emit(name, value, time, shape);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.181.0
2
+ Winter Cardinal UI v0.182.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.181.0
2
+ Winter Cardinal UI v0.182.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.181.0
2
+ Winter Cardinal UI v0.182.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.181.0
2
+ Winter Cardinal UI v0.182.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.181.0
2
+ Winter Cardinal UI v0.182.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -19034,6 +19034,12 @@ var DDiagrams = /** @class */ (function () {
19034
19034
  return DDiagrams;
19035
19035
  }());
19036
19036
 
19037
+ /*
19038
+ * Copyright (C) 2019 Toshiba Corporation
19039
+ * SPDX-License-Identifier: Apache-2.0
19040
+ */
19041
+ var EShapeActionOpenOpeners = {};
19042
+
19037
19043
  /*
19038
19044
  * Copyright (C) 2019 Toshiba Corporation
19039
19045
  * SPDX-License-Identifier: Apache-2.0
@@ -19058,30 +19064,31 @@ var EShapeActionRuntimes = /** @class */ (function () {
19058
19064
  return null;
19059
19065
  };
19060
19066
  EShapeActionRuntimes.open = function (shape, type, target, inNewWindow) {
19061
- var container = this.toContainer(shape);
19062
- if (container) {
19063
- var controller = container.controller;
19064
- if (controller) {
19065
- if (controller.open != null) {
19066
- controller.open(type, target, inNewWindow);
19067
- }
19068
- else {
19069
- switch (type) {
19070
- case DDiagramBaseControllerOpenType.DIAGRAM:
19067
+ var opener = EShapeActionOpenOpeners[type];
19068
+ if (opener != null) {
19069
+ opener(target, inNewWindow);
19070
+ }
19071
+ else {
19072
+ switch (type) {
19073
+ case DDiagramBaseControllerOpenType.DIAGRAM:
19074
+ var container_1 = this.toContainer(shape);
19075
+ if (container_1) {
19076
+ var controller = container_1.controller;
19077
+ if (controller) {
19071
19078
  controller.getByName(target).then(function (found) {
19072
- container.set(DDiagrams.toSerialized(found));
19079
+ container_1.set(DDiagrams.toSerialized(found));
19073
19080
  });
19074
- break;
19075
- case DDiagramBaseControllerOpenType.PAGE:
19076
- if (inNewWindow) {
19077
- window.open(target);
19078
- }
19079
- else {
19080
- window.location.href = target;
19081
- }
19082
- break;
19081
+ }
19083
19082
  }
19084
- }
19083
+ break;
19084
+ case DDiagramBaseControllerOpenType.PAGE:
19085
+ if (inNewWindow) {
19086
+ window.open(target);
19087
+ }
19088
+ else {
19089
+ window.location.href = target;
19090
+ }
19091
+ break;
19085
19092
  }
19086
19093
  }
19087
19094
  };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.181.0
2
+ Winter Cardinal UI v0.182.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -19031,6 +19031,12 @@
19031
19031
  return DDiagrams;
19032
19032
  }());
19033
19033
 
19034
+ /*
19035
+ * Copyright (C) 2019 Toshiba Corporation
19036
+ * SPDX-License-Identifier: Apache-2.0
19037
+ */
19038
+ var EShapeActionOpenOpeners = {};
19039
+
19034
19040
  /*
19035
19041
  * Copyright (C) 2019 Toshiba Corporation
19036
19042
  * SPDX-License-Identifier: Apache-2.0
@@ -19055,30 +19061,31 @@
19055
19061
  return null;
19056
19062
  };
19057
19063
  EShapeActionRuntimes.open = function (shape, type, target, inNewWindow) {
19058
- var container = this.toContainer(shape);
19059
- if (container) {
19060
- var controller = container.controller;
19061
- if (controller) {
19062
- if (controller.open != null) {
19063
- controller.open(type, target, inNewWindow);
19064
- }
19065
- else {
19066
- switch (type) {
19067
- case DDiagramBaseControllerOpenType.DIAGRAM:
19064
+ var opener = EShapeActionOpenOpeners[type];
19065
+ if (opener != null) {
19066
+ opener(target, inNewWindow);
19067
+ }
19068
+ else {
19069
+ switch (type) {
19070
+ case DDiagramBaseControllerOpenType.DIAGRAM:
19071
+ var container_1 = this.toContainer(shape);
19072
+ if (container_1) {
19073
+ var controller = container_1.controller;
19074
+ if (controller) {
19068
19075
  controller.getByName(target).then(function (found) {
19069
- container.set(DDiagrams.toSerialized(found));
19076
+ container_1.set(DDiagrams.toSerialized(found));
19070
19077
  });
19071
- break;
19072
- case DDiagramBaseControllerOpenType.PAGE:
19073
- if (inNewWindow) {
19074
- window.open(target);
19075
- }
19076
- else {
19077
- window.location.href = target;
19078
- }
19079
- break;
19078
+ }
19080
19079
  }
19081
- }
19080
+ break;
19081
+ case DDiagramBaseControllerOpenType.PAGE:
19082
+ if (inNewWindow) {
19083
+ window.open(target);
19084
+ }
19085
+ else {
19086
+ window.location.href = target;
19087
+ }
19088
+ break;
19082
19089
  }
19083
19090
  }
19084
19091
  };