@wcardinal/wcardinal-ui 0.355.0 → 0.357.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/d-diagram-canvas-base.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-diagram-serialized.d.ts +2 -0
- package/dist/wcardinal/ui/d-diagram-canvas-base.js +24 -7
- package/dist/wcardinal/ui/d-diagram-canvas-base.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-serialized.js.map +1 -1
- package/dist/wcardinal/ui/d-diagrams.js +2 -0
- package/dist/wcardinal/ui/d-diagrams.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +27 -8
- package/dist/wcardinal-ui.js +27 -8
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export interface DDiagramCanvasBackgroundOptions extends DBaseBackgroundOptions
|
|
|
10
10
|
}
|
|
11
11
|
export interface DDiagramCanvasBaseOptions<THEME extends DThemeDiagramCanvasBase = DThemeDiagramCanvasBase> extends DCanvasOptions<THEME> {
|
|
12
12
|
label?: string;
|
|
13
|
+
category?: string;
|
|
13
14
|
summary?: string;
|
|
14
15
|
description?: string;
|
|
15
16
|
tile?: DDiagramCanvasTileOptions;
|
|
@@ -23,6 +24,7 @@ export interface DThemeDiagramCanvasBase extends DThemeCanvas {
|
|
|
23
24
|
export declare class DDiagramCanvasBase<THEME extends DThemeDiagramCanvasBase = DThemeDiagramCanvasBase, OPTIONS extends DDiagramCanvasBaseOptions<THEME> = DDiagramCanvasBaseOptions<THEME>> extends DCanvas<THEME, OPTIONS> {
|
|
24
25
|
protected _layer: DDiagramLayerContainer;
|
|
25
26
|
protected _label: string;
|
|
27
|
+
protected _category: string;
|
|
26
28
|
protected _summary: string;
|
|
27
29
|
protected _description: string;
|
|
28
30
|
protected _tile: DDiagramCanvasTile;
|
|
@@ -31,6 +33,8 @@ export declare class DDiagramCanvasBase<THEME extends DThemeDiagramCanvasBase =
|
|
|
31
33
|
protected toBackgroundBase(theme: THEME, options?: OPTIONS): number | null;
|
|
32
34
|
get label(): string;
|
|
33
35
|
set label(label: string);
|
|
36
|
+
get category(): string;
|
|
37
|
+
set category(category: string);
|
|
34
38
|
get summary(): string;
|
|
35
39
|
set summary(summary: string);
|
|
36
40
|
get description(): string;
|
|
@@ -425,6 +425,7 @@ export interface DDiagramSerialized {
|
|
|
425
425
|
label?: string;
|
|
426
426
|
width: number;
|
|
427
427
|
height: number;
|
|
428
|
+
category?: string;
|
|
428
429
|
summary?: string;
|
|
429
430
|
description?: string;
|
|
430
431
|
background?: DDiagramSerializedBackground;
|
|
@@ -448,6 +449,7 @@ export interface DDiagramSerializedSimple {
|
|
|
448
449
|
id: number | undefined;
|
|
449
450
|
name: string;
|
|
450
451
|
label?: string;
|
|
452
|
+
category?: string;
|
|
451
453
|
summary?: string;
|
|
452
454
|
description?: string;
|
|
453
455
|
/**
|
|
@@ -11,7 +11,7 @@ var DDiagramCanvasBase = /** @class */ (function (_super) {
|
|
|
11
11
|
__extends(DDiagramCanvasBase, _super);
|
|
12
12
|
function DDiagramCanvasBase(options) {
|
|
13
13
|
var _this = this;
|
|
14
|
-
var _a, _b, _c;
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
15
|
_this = _super.call(this, options) || this;
|
|
16
16
|
// Background
|
|
17
17
|
var theme = _this.theme;
|
|
@@ -22,12 +22,19 @@ var DDiagramCanvasBase = /** @class */ (function (_super) {
|
|
|
22
22
|
var layer = new DDiagramLayerContainer(_this.width, _this.height);
|
|
23
23
|
_this._layer = layer;
|
|
24
24
|
_this.addChild(layer);
|
|
25
|
-
// Label
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
// Label, Category, Summary and Description
|
|
26
|
+
if (options != null) {
|
|
27
|
+
_this._label = (_a = options.label) !== null && _a !== void 0 ? _a : "";
|
|
28
|
+
_this._category = (_b = options.category) !== null && _b !== void 0 ? _b : "";
|
|
29
|
+
_this._summary = (_c = options.summary) !== null && _c !== void 0 ? _c : "";
|
|
30
|
+
_this._description = (_d = options.description) !== null && _d !== void 0 ? _d : "";
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
_this._label = "";
|
|
34
|
+
_this._category = "";
|
|
35
|
+
_this._summary = "";
|
|
36
|
+
_this._description = "";
|
|
37
|
+
}
|
|
31
38
|
// Tile
|
|
32
39
|
var tile = new DDiagramCanvasTile(_this, options === null || options === void 0 ? void 0 : options.tile);
|
|
33
40
|
_this._tile = tile;
|
|
@@ -52,6 +59,16 @@ var DDiagramCanvasBase = /** @class */ (function (_super) {
|
|
|
52
59
|
enumerable: false,
|
|
53
60
|
configurable: true
|
|
54
61
|
});
|
|
62
|
+
Object.defineProperty(DDiagramCanvasBase.prototype, "category", {
|
|
63
|
+
get: function () {
|
|
64
|
+
return this._category;
|
|
65
|
+
},
|
|
66
|
+
set: function (category) {
|
|
67
|
+
this._category = category;
|
|
68
|
+
},
|
|
69
|
+
enumerable: false,
|
|
70
|
+
configurable: true
|
|
71
|
+
});
|
|
55
72
|
Object.defineProperty(DDiagramCanvasBase.prototype, "summary", {
|
|
56
73
|
get: function () {
|
|
57
74
|
return this._summary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-diagram-canvas-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-canvas-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EAAE,OAAO,EAAgC,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAA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CAAO,GAAjB;QACC,OAAO,oBAAoB,CAAC;IAC7B,CAAC;IACF,yBAAC;AAAD,CAAC,AAhID,CAGU,OAAO,GA6HhB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint } from \"pixi.js\";\nimport { DBaseBackgroundOptions } from \"./d-base\";\nimport { DCanvas, DCanvasOptions, DThemeCanvas } from \"./d-canvas\";\nimport { DDiagramCanvasEditorBackground } from \"./d-diagram-canvas-editor-background\";\nimport { DDiagramCanvasTile, DDiagramCanvasTileOptions } from \"./d-diagram-canvas-tile\";\nimport { DDiagramDataMapper } from \"./d-diagram-data-mapper\";\nimport { DDiagramLayerContainer } from \"./d-diagram-layer-container\";\nimport { EShape } from \"./shape/e-shape\";\n\nexport interface DDiagramCanvasBackgroundOptions extends DBaseBackgroundOptions {\n\tbase?: number | null;\n}\n\nexport interface DDiagramCanvasBaseOptions<\n\tTHEME extends DThemeDiagramCanvasBase = DThemeDiagramCanvasBase\n> extends DCanvasOptions<THEME> {\n\tlabel?: string;\n\tcategory?: string;\n\tsummary?: string;\n\tdescription?: string;\n\ttile?: DDiagramCanvasTileOptions;\n\tbackground?: DDiagramCanvasBackgroundOptions;\n\tambient?: boolean;\n}\n\nexport interface DThemeDiagramCanvasBase extends DThemeCanvas {\n\tisAmbient(): boolean;\n\tgetBackgroundBase(): number | null;\n}\n\nexport class DDiagramCanvasBase<\n\tTHEME extends DThemeDiagramCanvasBase = DThemeDiagramCanvasBase,\n\tOPTIONS extends DDiagramCanvasBaseOptions<THEME> = DDiagramCanvasBaseOptions<THEME>\n> extends DCanvas<THEME, OPTIONS> {\n\tprotected _layer: DDiagramLayerContainer;\n\tprotected _label: string;\n\tprotected _category: string;\n\tprotected _summary: string;\n\tprotected _description: string;\n\tprotected _tile: DDiagramCanvasTile;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\t// Background\n\t\tconst theme = this.theme;\n\t\tif (!this.isAmbient(theme, options)) {\n\t\t\tthis._background = new DDiagramCanvasEditorBackground(\n\t\t\t\tthis._background,\n\t\t\t\tthis.toBackgroundBase(theme, options)\n\t\t\t);\n\t\t}\n\n\t\t// Layer\n\t\tconst layer = new DDiagramLayerContainer(this.width, this.height);\n\t\tthis._layer = layer;\n\t\tthis.addChild(layer);\n\n\t\t// Label, Category, Summary and Description\n\t\tif (options != null) {\n\t\t\tthis._label = options.label ?? \"\";\n\t\t\tthis._category = options.category ?? \"\";\n\t\t\tthis._summary = options.summary ?? \"\";\n\t\t\tthis._description = options.description ?? \"\";\n\t\t} else {\n\t\t\tthis._label = \"\";\n\t\t\tthis._category = \"\";\n\t\t\tthis._summary = \"\";\n\t\t\tthis._description = \"\";\n\t\t}\n\n\t\t// Tile\n\t\tconst tile = new DDiagramCanvasTile(this, options?.tile);\n\t\tthis._tile = tile;\n\t\ttile.init();\n\t}\n\n\tprotected isAmbient(theme: THEME, options?: OPTIONS): boolean {\n\t\treturn options?.ambient ?? theme.isAmbient();\n\t}\n\n\tprotected toBackgroundBase(theme: THEME, options?: OPTIONS): number | null {\n\t\treturn options?.background?.base ?? theme.getBackgroundBase();\n\t}\n\n\tget label(): string {\n\t\treturn this._label;\n\t}\n\n\tset label(label: string) {\n\t\tthis._label = label;\n\t}\n\n\tget category(): string {\n\t\treturn this._category;\n\t}\n\n\tset category(category: string) {\n\t\tthis._category = category;\n\t}\n\n\tget summary(): string {\n\t\treturn this._summary;\n\t}\n\n\tset summary(summary: string) {\n\t\tthis._summary = summary;\n\t}\n\n\tget description(): string {\n\t\treturn this._description;\n\t}\n\n\tset description(description: string) {\n\t\tthis._description = description;\n\t}\n\n\tget tile(): DDiagramCanvasTile {\n\t\treturn this._tile;\n\t}\n\n\tget layer(): DDiagramLayerContainer {\n\t\treturn this._layer;\n\t}\n\n\tinitialize(shapes: EShape[], mapper?: DDiagramDataMapper | null): void {\n\t\t// DO NOTHING\n\t}\n\n\tdestroy(): void {\n\t\tif (!this._destroyed) {\n\t\t\tthis.onDestroy();\n\t\t\tsuper.destroy();\n\t\t}\n\t}\n\n\tprotected onDestroy(): void {\n\t\tthis._tile.destroy();\n\t\tthis._layer.destroy();\n\t}\n\n\thitTest(global: IPoint, onHit?: (shape: EShape) => boolean): EShape | null {\n\t\tconst layers = this._layer.children;\n\t\tfor (let i = layers.length - 1; 0 <= i; --i) {\n\t\t\tconst layer = layers[i];\n\t\t\tif (layer.visible) {\n\t\t\t\tconst shape = layer.hitTest(global, onHit);\n\t\t\t\tif (shape != null) {\n\t\t\t\t\treturn shape;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDiagramCanvasBase\";\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-diagram-serialized.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-serialized.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,MAAM,CAAC,IAAM,yBAAyB,GAAW,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramCanvasTileMapping } from \"./d-diagram-canvas-mapping\";\nimport { EShapeCorner } from \"./shape/e-shape-corner\";\nimport { EShapeStrokeSide } from \"./shape/e-shape-stroke-side\";\nimport { EShapeStrokeStyle } from \"./shape/e-shape-stroke-style\";\nimport { EShapeDataValueOrder } from \"./shape/e-shape-data-value-order\";\nimport { EShapeTextStyle, EShapeTextWeight } from \"./shape/e-shape-text\";\nimport { EShapeTextAlignHorizontal } from \"./shape/e-shape-text-align-horizontal\";\nimport { EShapeTextAlignVertical } from \"./shape/e-shape-text-align-vertical\";\nimport { EShapeTextDirection } from \"./shape/e-shape-text-direction\";\nimport { EShapeType } from \"./shape/e-shape-type\";\nimport { ESnapperTargetValueType } from \"./snapper/e-snapper-target-value\";\nimport { EShapeDataValueRangeType } from \"./shape/e-shape-data-value-range\";\nimport { EShapeDataValueType } from \"./shape/e-shape-data-value-type\";\nimport { EShapeDataValueScope } from \"./shape/e-shape-data-value-scope\";\n\nexport const DDiagramSerializedVersion: number = 1;\n\n/**\n * A serialized data range.\n */\nexport interface DDiagramSerializedDataRange {\n\t/** A type. */\n\t[0]: EShapeDataValueRangeType;\n\n\t/** A lower bound. */\n\t[1]: number;\n\n\t/** An upper bound. */\n\t[2]: number;\n}\n\n/**\n * A serialized data value.\n */\nexport interface DDiagramSerializedDataValue {\n\t/**\n\t * A resource index number of an ID.\n\t */\n\t[0]: number;\n\n\t/**\n\t * A resource index number of an initial value expression.\n\t */\n\t[1]: number;\n\n\t/**\n\t * A resource index number of a format expression.\n\t */\n\t[2]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedDataRange).\n\t */\n\t[3]: number;\n\n\t/**\n\t * A capacity.\n\t */\n\t[4]: number;\n\n\t/**\n\t * A order.\n\t */\n\t[5]: EShapeDataValueOrder;\n\n\t/**\n\t * A type.\n\t */\n\t[6]: EShapeDataValueType | undefined;\n\n\t/**\n\t * A scope.\n\t */\n\t[7]: EShapeDataValueScope | undefined;\n\n\t/**\n\t * A resource index number of an alias.\n\t */\n\t[8]: number | undefined;\n}\n\n/**\n * A serialized system data.\n */\nexport type DDiagramSerializedDataSystem = number[];\n\n/**\n * A serialized data mapping.\n * Each number at the index 2N+0 is a resource index number of the N-th mapping source.\n * Each number at the index 2N+1 is a resource index number of the N-th mapping destination.\n */\nexport type DDiagramSerializedDataMapping = number[];\n\n/**\n * A serialized data with a mapping data.\n */\nexport interface DDiagramSerializedDataWithMapping extends Array<unknown> {\n\t/**\n\t * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).\n\t * The last number is a resource index number of JSON.stringify(DDiagramSerializedDataMapping).\n\t */\n\t[0]: number[];\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedDataSystem).\n\t */\n\t[1]: number | undefined;\n}\n\n/**\n * A serialized data without a mapping data.\n * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).\n */\nexport type DDiagramSerializedDataWithoutMapping = number[];\n\n/**\n * A serialized data.\n */\nexport type DDiagramSerializedData =\n\t| DDiagramSerializedDataWithoutMapping\n\t| DDiagramSerializedDataWithMapping;\n\n/**\n * A serialized fill.\n */\nexport interface DDiagramSerializedFill {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n}\n\n/**\n * A serialized stroke.\n */\nexport interface DDiagramSerializedStroke {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A width. */\n\t[3]: number;\n\n\t/** An align. */\n\t[4]: number;\n\n\t/** A side. */\n\t[5]: EShapeStrokeSide;\n\n\t/** A style */\n\t[6]: EShapeStrokeStyle | undefined;\n}\n\n/**\n * A serialized text outline.\n */\nexport interface DDiagramSerializedTextOutline {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A width. */\n\t[3]: number;\n}\n\n/**\n * A serialized text align.\n */\nexport interface DDiagramSerializedTextAlign {\n\t/** A horizontal align. */\n\t[0]: EShapeTextAlignHorizontal;\n\n\t/** A vertical align. */\n\t[1]: EShapeTextAlignVertical;\n}\n\n/**\n * A serialized text offset.\n */\nexport interface DDiagramSerializedTextOffset {\n\t/** A horizontal offset. */\n\t[0]: number;\n\n\t/** A vertical offset. */\n\t[1]: number;\n}\n\n/**\n * A serialized text spacing.\n */\nexport interface DDiagramSerializedTextSpacing {\n\t/** A horizontal spacing. */\n\t[0]: number;\n\n\t/** A vertical spacing. */\n\t[1]: number;\n}\n\n/**\n * A serialized text padding.\n */\nexport interface DDiagramSerializedTextPadding {\n\t/** A horizontal padding. */\n\t[0]: number;\n\n\t/** A vertical padding. */\n\t[1]: number;\n}\n\n/**\n * A serialized text.\n */\nexport interface DDiagramSerializedText {\n\t/** A resource index number of a value. */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A resource index number of a font family. */\n\t[3]: number;\n\n\t/** A size. */\n\t[4]: number;\n\n\t/** A weight. */\n\t[5]: EShapeTextWeight;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextAlign).\n\t */\n\t[6]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextOffset).\n\t */\n\t[7]: number;\n\n\t/** A style. */\n\t[8]: EShapeTextStyle;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextOutline).\n\t */\n\t[9]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextSpacing).\n\t */\n\t[10]: number;\n\n\t/** A direction. */\n\t[11]: EShapeTextDirection;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextPadding).\n\t */\n\t[12]: number;\n\n\t/** A clipping. (0: Off, 1: On) */\n\t[13]: number;\n\n\t/** A fitting. (0: Off, 1: On) */\n\t[14]: number;\n}\n\n/**\n * A serialized item.\n */\nexport interface DDiagramSerializedItem {\n\t/** A type. */\n\t[0]: EShapeType;\n\n\t/** A resource index number of a ID. */\n\t[1]: number;\n\n\t/** A X-coordinate position. */\n\t[2]: number;\n\n\t/** A Y-coordinate position. */\n\t[3]: number;\n\n\t/** A width. */\n\t[4]: number;\n\n\t/** A height. */\n\t[5]: number;\n\n\t/** A rotation. */\n\t[6]: number;\n\n\t/** A skew. */\n\t[7]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedFill).\n\t */\n\t[8]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedStroke).\n\t */\n\t[9]: number;\n\n\t/** A resource index number of a cursor. */\n\t[10]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedText).\n\t */\n\t[11]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedData).\n\t */\n\t[12]: number;\n\n\t/** A radius. */\n\t[13]: number;\n\n\t/** A corner. */\n\t[14]: EShapeCorner;\n\n\t/** A resource index number of a shape-specific resource. */\n\t[15]: number;\n\n\t/** A layer index number. */\n\t[16]: number;\n\n\t/** Actions */\n\t[17]: number[];\n\n\t/** A resource index number of an image. */\n\t[18]: number;\n\n\t/**\n\t * A resource index number of a stringified serialized gradient.\n\t * A stringified serialized gradient is a stringified number array,\n\t * JSON.stringify(number[]).\n\t *\n\t * * The first number in the array is a direction in degree.\n\t * * Each number at the index 3N + 1 is a color of a N-th point.\n\t * * Each number at the index 3N + 2 is a alpha of a N-th point.\n\t * * Each number at the index 3N + 3 is a position of a N-th point whose range is [0, 1].\n\t */\n\t[19]: number;\n\n\t/** Children. */\n\t[20]: DDiagramSerializedItem[];\n\n\t/** A X pivot. */\n\t[21]: number;\n\n\t/** A Y pivot. */\n\t[22]: number;\n\n\t/** (interactive ? 1 : 0) | (unfocusable ? 2 : 0) */\n\t[23]: number;\n\n\t/** A resource index number of a shortcut. */\n\t[24]: number;\n\n\t/** A resource index number of a title. */\n\t[25]: number;\n\n\t/** UUID */\n\t[26]: number;\n\n\t/** Added capabilities */\n\t[27]: number;\n\n\t/** Removed capabilities */\n\t[28]: number;\n\n\t/** Locked capabilities */\n\t[29]: number;\n}\n\n/**\n * A serialized layer.\n */\nexport interface DDiagramSerializedLayer {\n\t/** A name or a resource index number of a name*/\n\t[0]: string | number;\n\n\t/**\n\t * A visibility.\n\t *\n\t * * 1st bit\n\t * * 0: Invisible when edit mode\n\t * * 1: Visible when edit mode\n\t * * 2nd bit\n\t * * 0: Invisible when non-edit mode\n\t * * 1: Visible when non-edit mode\n\t */\n\t[1]?: number;\n\n\t/** A X-coordinate position. */\n\t[2]?: number;\n\n\t/** A Y-coordinate position. */\n\t[3]?: number;\n\n\t/** A width. */\n\t[4]?: number;\n\n\t/** A height. */\n\t[5]?: number;\n\n\t/**\n\t * A resource index number of a stringified serialized fill,\n\t * JSON.stringify(DDiagramSerializedFill).\n\t */\n\t[6]?: number;\n\n\t/**\n\t * * 1st bit\n\t * * 0: Not interactive\n\t * * 1: Interactive\n\t * * 2nd bit\n\t * * 0: Not draggable\n\t * * 1: Draggable\n\t * * 3rd bit\n\t * * 0: Not pinchable\n\t * * 1: Pinchable\n\t */\n\t[7]?: number;\n}\n\n/**\n * A serialized snap target.\n */\nexport interface DDiagramSerializedSnapTargetValue {\n\t/** A type. */\n\t[0]: ESnapperTargetValueType;\n\n\t/** A position. */\n\t[1]: number;\n}\n\n/**\n * Serialized snap on guide settings.\n */\nexport interface DDiagramSerializedSnapTarget {\n\t/** Snap on guide (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A visibility (0: Invisible, 1: Visible). */\n\t[1]: number;\n\n\t/** Snap targets. */\n\t[2]: DDiagramSerializedSnapTargetValue[];\n}\n\n/**\n * Serialized grid snap settings without a visibility option.\n */\nexport interface DDiagramSerializedSnapGridWithoutVisibility {\n\t/** Snap on grid (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A grid size. */\n\t[1]: number;\n}\n\n/**\n * Serialized grid snap settings with a visibility option.\n */\nexport interface DDiagramSerializedSnapGridWithVisibility {\n\t/** Snap on grid (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A visibility (0: Invisible, 1: Visible). */\n\t[1]: number;\n\n\t/** A grid size. */\n\t[2]: number;\n}\n\n/**\n * Serialized grid snap settings with a visibility.\n */\nexport type DDiagramSerializedSnapGrid =\n\t| DDiagramSerializedSnapGridWithoutVisibility\n\t| DDiagramSerializedSnapGridWithVisibility;\n\n/**\n * Serialized snap settings.\n */\nexport interface DDiagramSerializedSnap {\n\t/** Snap (0: Off, 1: On). */\n\t[0]: number;\n\n\t/** Snap on targets */\n\t[1]: DDiagramSerializedSnapTarget;\n\n\t/** Snap on grid */\n\t[2]: DDiagramSerializedSnapGrid;\n}\n\n/**\n * Serialized background settings.\n */\nexport interface DDiagramSerializedBackground {\n\tcolor?: number | null;\n\talpha?: number;\n}\n\n/**\n * Serialized tile settings.\n */\nexport interface DDiagramSerializedTile {\n\tmapping?: DDiagramCanvasTileMapping;\n}\n\n/**\n * A serialized diagram.\n */\nexport interface DDiagramSerialized {\n\tversion: number;\n\tid?: number;\n\tname: string;\n\tlabel?: string;\n\twidth: number;\n\theight: number;\n\tsummary?: string;\n\tdescription?: string;\n\tbackground?: DDiagramSerializedBackground;\n\ttile?: DDiagramSerializedTile;\n\tresources: string[];\n\t/** @deprecated in favor of {@link data} */\n\ttags?: string[];\n\tdata?: string[];\n\tpieces?: string[];\n\tlayers: DDiagramSerializedLayer[];\n\titems: DDiagramSerializedItem[];\n\tsnap?: DDiagramSerializedSnap;\n\tthumbnail?: string;\n}\n\nexport type DDiagramSerializedSimpleData = Omit<\n\tDDiagramSerialized,\n\t\"version\" | \"id\" | \"name\" | \"thumbnail\"\n>;\n\n/**\n * A simplified version of a serialized diagram.\n */\nexport interface DDiagramSerializedSimple {\n\tversion: number;\n\tid: number | undefined;\n\tname: string;\n\tlabel?: string;\n\tsummary?: string;\n\tdescription?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerialized#data}.\n\t *\n\t * @deprecated in favor of {@link DDiagramSerializedSimpleData}.\n\t */\n\ttags?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerialized#pieces}.\n\t *\n\t * @deprecated in favor of {@link DDiagramSerializedSimpleData}.\n\t */\n\tpieces?: string;\n\n\t/**\n\t * Thumbnail data URL.\n\t */\n\tthumbnail?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerializedSimpleData}.\n\t */\n\tdata: string;\n}\n\nexport interface DDiagramSerializedName {\n\tid: number;\n\tname: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-diagram-serialized.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-serialized.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,MAAM,CAAC,IAAM,yBAAyB,GAAW,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramCanvasTileMapping } from \"./d-diagram-canvas-mapping\";\nimport { EShapeCorner } from \"./shape/e-shape-corner\";\nimport { EShapeStrokeSide } from \"./shape/e-shape-stroke-side\";\nimport { EShapeStrokeStyle } from \"./shape/e-shape-stroke-style\";\nimport { EShapeDataValueOrder } from \"./shape/e-shape-data-value-order\";\nimport { EShapeTextStyle, EShapeTextWeight } from \"./shape/e-shape-text\";\nimport { EShapeTextAlignHorizontal } from \"./shape/e-shape-text-align-horizontal\";\nimport { EShapeTextAlignVertical } from \"./shape/e-shape-text-align-vertical\";\nimport { EShapeTextDirection } from \"./shape/e-shape-text-direction\";\nimport { EShapeType } from \"./shape/e-shape-type\";\nimport { ESnapperTargetValueType } from \"./snapper/e-snapper-target-value\";\nimport { EShapeDataValueRangeType } from \"./shape/e-shape-data-value-range\";\nimport { EShapeDataValueType } from \"./shape/e-shape-data-value-type\";\nimport { EShapeDataValueScope } from \"./shape/e-shape-data-value-scope\";\n\nexport const DDiagramSerializedVersion: number = 1;\n\n/**\n * A serialized data range.\n */\nexport interface DDiagramSerializedDataRange {\n\t/** A type. */\n\t[0]: EShapeDataValueRangeType;\n\n\t/** A lower bound. */\n\t[1]: number;\n\n\t/** An upper bound. */\n\t[2]: number;\n}\n\n/**\n * A serialized data value.\n */\nexport interface DDiagramSerializedDataValue {\n\t/**\n\t * A resource index number of an ID.\n\t */\n\t[0]: number;\n\n\t/**\n\t * A resource index number of an initial value expression.\n\t */\n\t[1]: number;\n\n\t/**\n\t * A resource index number of a format expression.\n\t */\n\t[2]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedDataRange).\n\t */\n\t[3]: number;\n\n\t/**\n\t * A capacity.\n\t */\n\t[4]: number;\n\n\t/**\n\t * A order.\n\t */\n\t[5]: EShapeDataValueOrder;\n\n\t/**\n\t * A type.\n\t */\n\t[6]: EShapeDataValueType | undefined;\n\n\t/**\n\t * A scope.\n\t */\n\t[7]: EShapeDataValueScope | undefined;\n\n\t/**\n\t * A resource index number of an alias.\n\t */\n\t[8]: number | undefined;\n}\n\n/**\n * A serialized system data.\n */\nexport type DDiagramSerializedDataSystem = number[];\n\n/**\n * A serialized data mapping.\n * Each number at the index 2N+0 is a resource index number of the N-th mapping source.\n * Each number at the index 2N+1 is a resource index number of the N-th mapping destination.\n */\nexport type DDiagramSerializedDataMapping = number[];\n\n/**\n * A serialized data with a mapping data.\n */\nexport interface DDiagramSerializedDataWithMapping extends Array<unknown> {\n\t/**\n\t * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).\n\t * The last number is a resource index number of JSON.stringify(DDiagramSerializedDataMapping).\n\t */\n\t[0]: number[];\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedDataSystem).\n\t */\n\t[1]: number | undefined;\n}\n\n/**\n * A serialized data without a mapping data.\n * Each number is a resource index number of JSON.stringify(DDiagramSerializedDataValue).\n */\nexport type DDiagramSerializedDataWithoutMapping = number[];\n\n/**\n * A serialized data.\n */\nexport type DDiagramSerializedData =\n\t| DDiagramSerializedDataWithoutMapping\n\t| DDiagramSerializedDataWithMapping;\n\n/**\n * A serialized fill.\n */\nexport interface DDiagramSerializedFill {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n}\n\n/**\n * A serialized stroke.\n */\nexport interface DDiagramSerializedStroke {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A width. */\n\t[3]: number;\n\n\t/** An align. */\n\t[4]: number;\n\n\t/** A side. */\n\t[5]: EShapeStrokeSide;\n\n\t/** A style */\n\t[6]: EShapeStrokeStyle | undefined;\n}\n\n/**\n * A serialized text outline.\n */\nexport interface DDiagramSerializedTextOutline {\n\t/** 0: Disabled, 1: Enabled */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A width. */\n\t[3]: number;\n}\n\n/**\n * A serialized text align.\n */\nexport interface DDiagramSerializedTextAlign {\n\t/** A horizontal align. */\n\t[0]: EShapeTextAlignHorizontal;\n\n\t/** A vertical align. */\n\t[1]: EShapeTextAlignVertical;\n}\n\n/**\n * A serialized text offset.\n */\nexport interface DDiagramSerializedTextOffset {\n\t/** A horizontal offset. */\n\t[0]: number;\n\n\t/** A vertical offset. */\n\t[1]: number;\n}\n\n/**\n * A serialized text spacing.\n */\nexport interface DDiagramSerializedTextSpacing {\n\t/** A horizontal spacing. */\n\t[0]: number;\n\n\t/** A vertical spacing. */\n\t[1]: number;\n}\n\n/**\n * A serialized text padding.\n */\nexport interface DDiagramSerializedTextPadding {\n\t/** A horizontal padding. */\n\t[0]: number;\n\n\t/** A vertical padding. */\n\t[1]: number;\n}\n\n/**\n * A serialized text.\n */\nexport interface DDiagramSerializedText {\n\t/** A resource index number of a value. */\n\t[0]: number;\n\n\t/** A color. */\n\t[1]: number;\n\n\t/** An alpha. */\n\t[2]: number;\n\n\t/** A resource index number of a font family. */\n\t[3]: number;\n\n\t/** A size. */\n\t[4]: number;\n\n\t/** A weight. */\n\t[5]: EShapeTextWeight;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextAlign).\n\t */\n\t[6]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextOffset).\n\t */\n\t[7]: number;\n\n\t/** A style. */\n\t[8]: EShapeTextStyle;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextOutline).\n\t */\n\t[9]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextSpacing).\n\t */\n\t[10]: number;\n\n\t/** A direction. */\n\t[11]: EShapeTextDirection;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedTextPadding).\n\t */\n\t[12]: number;\n\n\t/** A clipping. (0: Off, 1: On) */\n\t[13]: number;\n\n\t/** A fitting. (0: Off, 1: On) */\n\t[14]: number;\n}\n\n/**\n * A serialized item.\n */\nexport interface DDiagramSerializedItem {\n\t/** A type. */\n\t[0]: EShapeType;\n\n\t/** A resource index number of a ID. */\n\t[1]: number;\n\n\t/** A X-coordinate position. */\n\t[2]: number;\n\n\t/** A Y-coordinate position. */\n\t[3]: number;\n\n\t/** A width. */\n\t[4]: number;\n\n\t/** A height. */\n\t[5]: number;\n\n\t/** A rotation. */\n\t[6]: number;\n\n\t/** A skew. */\n\t[7]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedFill).\n\t */\n\t[8]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedStroke).\n\t */\n\t[9]: number;\n\n\t/** A resource index number of a cursor. */\n\t[10]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedText).\n\t */\n\t[11]: number;\n\n\t/**\n\t * A resource index number of JSON.stringify(DDiagramSerializedData).\n\t */\n\t[12]: number;\n\n\t/** A radius. */\n\t[13]: number;\n\n\t/** A corner. */\n\t[14]: EShapeCorner;\n\n\t/** A resource index number of a shape-specific resource. */\n\t[15]: number;\n\n\t/** A layer index number. */\n\t[16]: number;\n\n\t/** Actions */\n\t[17]: number[];\n\n\t/** A resource index number of an image. */\n\t[18]: number;\n\n\t/**\n\t * A resource index number of a stringified serialized gradient.\n\t * A stringified serialized gradient is a stringified number array,\n\t * JSON.stringify(number[]).\n\t *\n\t * * The first number in the array is a direction in degree.\n\t * * Each number at the index 3N + 1 is a color of a N-th point.\n\t * * Each number at the index 3N + 2 is a alpha of a N-th point.\n\t * * Each number at the index 3N + 3 is a position of a N-th point whose range is [0, 1].\n\t */\n\t[19]: number;\n\n\t/** Children. */\n\t[20]: DDiagramSerializedItem[];\n\n\t/** A X pivot. */\n\t[21]: number;\n\n\t/** A Y pivot. */\n\t[22]: number;\n\n\t/** (interactive ? 1 : 0) | (unfocusable ? 2 : 0) */\n\t[23]: number;\n\n\t/** A resource index number of a shortcut. */\n\t[24]: number;\n\n\t/** A resource index number of a title. */\n\t[25]: number;\n\n\t/** UUID */\n\t[26]: number;\n\n\t/** Added capabilities */\n\t[27]: number;\n\n\t/** Removed capabilities */\n\t[28]: number;\n\n\t/** Locked capabilities */\n\t[29]: number;\n}\n\n/**\n * A serialized layer.\n */\nexport interface DDiagramSerializedLayer {\n\t/** A name or a resource index number of a name*/\n\t[0]: string | number;\n\n\t/**\n\t * A visibility.\n\t *\n\t * * 1st bit\n\t * * 0: Invisible when edit mode\n\t * * 1: Visible when edit mode\n\t * * 2nd bit\n\t * * 0: Invisible when non-edit mode\n\t * * 1: Visible when non-edit mode\n\t */\n\t[1]?: number;\n\n\t/** A X-coordinate position. */\n\t[2]?: number;\n\n\t/** A Y-coordinate position. */\n\t[3]?: number;\n\n\t/** A width. */\n\t[4]?: number;\n\n\t/** A height. */\n\t[5]?: number;\n\n\t/**\n\t * A resource index number of a stringified serialized fill,\n\t * JSON.stringify(DDiagramSerializedFill).\n\t */\n\t[6]?: number;\n\n\t/**\n\t * * 1st bit\n\t * * 0: Not interactive\n\t * * 1: Interactive\n\t * * 2nd bit\n\t * * 0: Not draggable\n\t * * 1: Draggable\n\t * * 3rd bit\n\t * * 0: Not pinchable\n\t * * 1: Pinchable\n\t */\n\t[7]?: number;\n}\n\n/**\n * A serialized snap target.\n */\nexport interface DDiagramSerializedSnapTargetValue {\n\t/** A type. */\n\t[0]: ESnapperTargetValueType;\n\n\t/** A position. */\n\t[1]: number;\n}\n\n/**\n * Serialized snap on guide settings.\n */\nexport interface DDiagramSerializedSnapTarget {\n\t/** Snap on guide (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A visibility (0: Invisible, 1: Visible). */\n\t[1]: number;\n\n\t/** Snap targets. */\n\t[2]: DDiagramSerializedSnapTargetValue[];\n}\n\n/**\n * Serialized grid snap settings without a visibility option.\n */\nexport interface DDiagramSerializedSnapGridWithoutVisibility {\n\t/** Snap on grid (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A grid size. */\n\t[1]: number;\n}\n\n/**\n * Serialized grid snap settings with a visibility option.\n */\nexport interface DDiagramSerializedSnapGridWithVisibility {\n\t/** Snap on grid (0: Off, 1: On) */\n\t[0]: number;\n\n\t/** A visibility (0: Invisible, 1: Visible). */\n\t[1]: number;\n\n\t/** A grid size. */\n\t[2]: number;\n}\n\n/**\n * Serialized grid snap settings with a visibility.\n */\nexport type DDiagramSerializedSnapGrid =\n\t| DDiagramSerializedSnapGridWithoutVisibility\n\t| DDiagramSerializedSnapGridWithVisibility;\n\n/**\n * Serialized snap settings.\n */\nexport interface DDiagramSerializedSnap {\n\t/** Snap (0: Off, 1: On). */\n\t[0]: number;\n\n\t/** Snap on targets */\n\t[1]: DDiagramSerializedSnapTarget;\n\n\t/** Snap on grid */\n\t[2]: DDiagramSerializedSnapGrid;\n}\n\n/**\n * Serialized background settings.\n */\nexport interface DDiagramSerializedBackground {\n\tcolor?: number | null;\n\talpha?: number;\n}\n\n/**\n * Serialized tile settings.\n */\nexport interface DDiagramSerializedTile {\n\tmapping?: DDiagramCanvasTileMapping;\n}\n\n/**\n * A serialized diagram.\n */\nexport interface DDiagramSerialized {\n\tversion: number;\n\tid?: number;\n\tname: string;\n\tlabel?: string;\n\twidth: number;\n\theight: number;\n\tcategory?: string;\n\tsummary?: string;\n\tdescription?: string;\n\tbackground?: DDiagramSerializedBackground;\n\ttile?: DDiagramSerializedTile;\n\tresources: string[];\n\t/** @deprecated in favor of {@link data} */\n\ttags?: string[];\n\tdata?: string[];\n\tpieces?: string[];\n\tlayers: DDiagramSerializedLayer[];\n\titems: DDiagramSerializedItem[];\n\tsnap?: DDiagramSerializedSnap;\n\tthumbnail?: string;\n}\n\nexport type DDiagramSerializedSimpleData = Omit<\n\tDDiagramSerialized,\n\t\"version\" | \"id\" | \"name\" | \"thumbnail\"\n>;\n\n/**\n * A simplified version of a serialized diagram.\n */\nexport interface DDiagramSerializedSimple {\n\tversion: number;\n\tid: number | undefined;\n\tname: string;\n\tlabel?: string;\n\tcategory?: string;\n\tsummary?: string;\n\tdescription?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerialized#data}.\n\t *\n\t * @deprecated in favor of {@link DDiagramSerializedSimpleData}.\n\t */\n\ttags?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerialized#pieces}.\n\t *\n\t * @deprecated in favor of {@link DDiagramSerializedSimpleData}.\n\t */\n\tpieces?: string;\n\n\t/**\n\t * Thumbnail data URL.\n\t */\n\tthumbnail?: string;\n\n\t/**\n\t * A stringified {@link DDiagramSerializedSimpleData}.\n\t */\n\tdata: string;\n}\n\nexport interface DDiagramSerializedName {\n\tid: number;\n\tname: string;\n}\n"]}
|
|
@@ -15,6 +15,7 @@ var DDiagrams = /** @class */ (function () {
|
|
|
15
15
|
id: serialized.id,
|
|
16
16
|
name: serialized.name,
|
|
17
17
|
label: serialized.label,
|
|
18
|
+
category: serialized.category,
|
|
18
19
|
summary: serialized.summary,
|
|
19
20
|
description: serialized.description,
|
|
20
21
|
thumbnail: serialized.thumbnail,
|
|
@@ -42,6 +43,7 @@ var DDiagrams = /** @class */ (function () {
|
|
|
42
43
|
label: target.label,
|
|
43
44
|
width: data.width,
|
|
44
45
|
height: data.height,
|
|
46
|
+
category: target.category,
|
|
45
47
|
summary: target.summary,
|
|
46
48
|
description: target.description,
|
|
47
49
|
background: data.background,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-diagrams.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagrams.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,oCAAoC,EAAE,MAAM,kDAAkD,CAAC;AAExG,OAAO,EAAE,cAAc,E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AAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IACF,gBAAC;AAAD,CAAC,AAtMD,IAsMC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramBaseController } from \"./d-diagram-base-controller\";\nimport { DDiagramLayerContainer } from \"./d-diagram-layer-container\";\nimport {\n\tDDiagramSerialized,\n\tDDiagramSerializedSimple,\n\tDDiagramSerializedSimpleData\n} from \"./d-diagram-serialized\";\nimport { EShape } from \"./shape/e-shape\";\nimport { EShapeLayerContainer } from \"./shape/e-shape-layer-container\";\nimport { EShapeResourceManagerDeserialization } from \"./shape/e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerDeserializationMode } from \"./shape/e-shape-resource-manager-deserialization-mode\";\nimport { deserializeAll } from \"./shape/variant/deserialize-all\";\nimport { EShapeEmbeddedDatum } from \"./shape/variant/e-shape-embedded-datum\";\nimport { EShapeEmbeddedLayerContainer } from \"./shape/variant/e-shape-embedded-layer-container\";\n\nexport class DDiagrams {\n\tstatic toSimple(serialized: DDiagramSerialized): DDiagramSerializedSimple {\n\t\treturn {\n\t\t\tversion: serialized.version,\n\t\t\tid: serialized.id,\n\t\t\tname: serialized.name,\n\t\t\tlabel: serialized.label,\n\t\t\tsummary: serialized.summary,\n\t\t\tdescription: serialized.description,\n\t\t\tthumbnail: serialized.thumbnail,\n\t\t\tdata: JSON.stringify({\n\t\t\t\twidth: serialized.width,\n\t\t\t\theight: serialized.height,\n\t\t\t\tbackground: serialized.background,\n\t\t\t\ttile: serialized.tile,\n\t\t\t\tresources: serialized.resources,\n\t\t\t\tdata: serialized.data || serialized.tags,\n\t\t\t\tpieces: serialized.pieces,\n\t\t\t\tlayers: serialized.layers,\n\t\t\t\titems: serialized.items,\n\t\t\t\tsnap: serialized.snap\n\t\t\t})\n\t\t};\n\t}\n\n\tstatic toSerialized(target: DDiagramSerializedSimple | DDiagramSerialized): DDiagramSerialized {\n\t\tif (!(\"items\" in target)) {\n\t\t\tconst data: DDiagramSerializedSimpleData = JSON.parse(target.data);\n\t\t\tconst result: DDiagramSerialized = {\n\t\t\t\tversion: target.version,\n\t\t\t\tid: target.id,\n\t\t\t\tname: target.name,\n\t\t\t\tlabel: target.label,\n\t\t\t\twidth: data.width,\n\t\t\t\theight: data.height,\n\t\t\t\tsummary: target.summary,\n\t\t\t\tdescription: target.description,\n\t\t\t\tbackground: data.background,\n\t\t\t\ttile: data.tile,\n\t\t\t\tresources: data.resources,\n\t\t\t\tdata: data.data || data.tags,\n\t\t\t\tpieces: data.pieces,\n\t\t\t\tlayers: data.layers,\n\t\t\t\titems: data.items,\n\t\t\t\tsnap: data.snap,\n\t\t\t\tthumbnail: target.thumbnail\n\t\t\t};\n\t\t\tif (result.data == null) {\n\t\t\t\tconst tags = target.tags;\n\t\t\t\tif (tags != null) {\n\t\t\t\t\tresult.data = JSON.parse(tags);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (result.pieces == null) {\n\t\t\t\tconst pieces = target.pieces;\n\t\t\t\tif (pieces != null) {\n\t\t\t\t\tresult.pieces = JSON.parse(pieces);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\treturn target;\n\t}\n\n\tstatic newLayer(\n\t\tserialized: DDiagramSerialized,\n\t\tcontainer: DDiagramLayerContainer | EShapeLayerContainer,\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): Promise<EShape[]> {\n\t\t// Layers\n\t\tcontainer.deserialize(serialized.layers, manager);\n\n\t\t// Items\n\t\tconst serializedItems = serialized.items;\n\t\tconst shapePromises = deserializeAll(serializedItems, manager);\n\t\tif (shapePromises != null) {\n\t\t\treturn shapePromises.then((shapes: EShape[]): EShape[] => {\n\t\t\t\tconst layers = container.children;\n\t\t\t\tfor (let i = 0, imax = shapes.length; i < imax; ++i) {\n\t\t\t\t\tconst serializedItem = serializedItems[i];\n\t\t\t\t\tconst shape = shapes[i];\n\t\t\t\t\tconst layer = layers[serializedItem[16]];\n\t\t\t\t\tif (layer != null) {\n\t\t\t\t\t\tshape.parent = layer;\n\t\t\t\t\t\tshape.uploaded = undefined;\n\t\t\t\t\t\tlayer.children.push(shape);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (let i = 0, imax = layers.length; i < imax; ++i) {\n\t\t\t\t\tconst layer = layers[i];\n\t\t\t\t\tlayer.onChildTransformChange();\n\t\t\t\t\tlayer.toDirty();\n\t\t\t\t\tconst children = layer.children;\n\t\t\t\t\tfor (let j = 0, jmax = children.length; j < jmax; ++j) {\n\t\t\t\t\t\tchildren[j].onAttach();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn shapes;\n\t\t\t});\n\t\t} else {\n\t\t\treturn Promise.resolve([]);\n\t\t}\n\t}\n\n\tstatic toPieceData(\n\t\tcontroller: DDiagramBaseController | null | undefined,\n\t\tpieces: string[] | null | undefined,\n\t\tmode: EShapeResourceManagerDeserializationMode\n\t): Promise<Map<string, EShapeEmbeddedDatum | null>> {\n\t\tconst pieceToDatum = new Map<string, EShapeEmbeddedDatum | null>();\n\t\tconst pieceToPromise = new Map<string, Promise<EShape[] | null>>();\n\t\tconst onFulfilled = () => {\n\t\t\treturn pieceToDatum;\n\t\t};\n\t\treturn this.toPieceData_(controller, pieces, pieceToDatum, pieceToPromise, mode, 0).then(\n\t\t\tonFulfilled,\n\t\t\tonFulfilled\n\t\t);\n\t}\n\n\tprivate static toPieceData_(\n\t\tcontroller: DDiagramBaseController | null | undefined,\n\t\tpieces: string[] | null | undefined,\n\t\tpieceToDatum: Map<string, EShapeEmbeddedDatum | null>,\n\t\tpieceToPromise: Map<string, Promise<EShape[] | null>>,\n\t\tmode: EShapeResourceManagerDeserializationMode,\n\t\tdepth: number\n\t): Promise<Array<EShape[] | null>> {\n\t\tconst promises: Array<Promise<EShape[] | null>> = [];\n\t\tif (pieces && 0 < pieces.length && controller) {\n\t\t\tfor (let i = 0, imax = pieces.length; i < imax; ++i) {\n\t\t\t\tconst piece = pieces[i];\n\t\t\t\tconst promise = pieceToPromise.get(piece);\n\t\t\t\tif (promise != null) {\n\t\t\t\t\tpromises.push(promise);\n\t\t\t\t} else {\n\t\t\t\t\tconst newPromise = controller.piece.getByName(piece).then(\n\t\t\t\t\t\t(found) => {\n\t\t\t\t\t\t\treturn this.toPieceData__(\n\t\t\t\t\t\t\t\tcontroller,\n\t\t\t\t\t\t\t\tpiece,\n\t\t\t\t\t\t\t\tfound,\n\t\t\t\t\t\t\t\tmode,\n\t\t\t\t\t\t\t\tdepth + 1,\n\t\t\t\t\t\t\t\tpieceToDatum,\n\t\t\t\t\t\t\t\tpieceToPromise\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tpieceToPromise.set(piece, newPromise);\n\t\t\t\t\tpromises.push(newPromise);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Promise.all(promises);\n\t}\n\n\tprivate static toPieceData__(\n\t\tcontroller: DDiagramBaseController,\n\t\tname: string,\n\t\tserializedOrSimple: DDiagramSerialized | DDiagramSerializedSimple,\n\t\tmode: EShapeResourceManagerDeserializationMode,\n\t\tdepth: number,\n\t\tpieceToDatum: Map<string, EShapeEmbeddedDatum | null>,\n\t\tpieceToPromise: Map<string, Promise<EShape[] | null>>\n\t): Promise<EShape[]> {\n\t\tconst serialized = this.toSerialized(serializedOrSimple);\n\t\tconst width = serialized.width;\n\t\tconst height = serialized.height;\n\t\tconst container = new EShapeEmbeddedLayerContainer(width, height);\n\n\t\tpieceToDatum.set(name, new EShapeEmbeddedDatum(name, width, height, container));\n\n\t\tconst pieces = serialized.pieces;\n\t\treturn this.toPieceData_(\n\t\t\tcontroller,\n\t\t\tpieces,\n\t\t\tpieceToDatum,\n\t\t\tpieceToPromise,\n\t\t\tmode,\n\t\t\tdepth\n\t\t).then(() => {\n\t\t\treturn this.newLayer(\n\t\t\t\tserialized,\n\t\t\t\tcontainer,\n\t\t\t\tnew EShapeResourceManagerDeserialization(\n\t\t\t\t\tserialized,\n\t\t\t\t\tpieces,\n\t\t\t\t\tpieceToDatum,\n\t\t\t\t\tmode,\n\t\t\t\t\tdepth\n\t\t\t\t)\n\t\t\t);\n\t\t});\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-diagrams.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagrams.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,oCAAoC,EAAE,MAAM,kDAAkD,CAAC;AAExG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAEhG;IAAA;IAwMA,CAAC;IAvMO,kBAAQ,GAAf,UAAgB,UAA8B;QAC7C,OAAO;YACN,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACpB,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,UAAU,EAAE,UAAU,CAAC,UAAU;gBACjC,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,SAAS,EAAE,UAAU,CAAC,SAAS;gBAC/B,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI;gBACxC,MAAM,EAAE,U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,SAAS,GAAG,IAAI,4BAA4B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAElE,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;QAEhF,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QACjC,OAAO,IAAI,CAAC,YAAY,CACvB,UAAU,EACV,MAAM,EACN,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,KAAK,CACL,CAAC,IAAI,CAAC;YACN,OAAO,KAAI,CAAC,QAAQ,CACnB,UAAU,EACV,SAAS,EACT,IAAI,oCAAoC,CACvC,UAAU,EACV,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,KAAK,CACL,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IACF,gBAAC;AAAD,CAAC,AAxMD,IAwMC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramBaseController } from \"./d-diagram-base-controller\";\nimport { DDiagramLayerContainer } from \"./d-diagram-layer-container\";\nimport {\n\tDDiagramSerialized,\n\tDDiagramSerializedSimple,\n\tDDiagramSerializedSimpleData\n} from \"./d-diagram-serialized\";\nimport { EShape } from \"./shape/e-shape\";\nimport { EShapeLayerContainer } from \"./shape/e-shape-layer-container\";\nimport { EShapeResourceManagerDeserialization } from \"./shape/e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerDeserializationMode } from \"./shape/e-shape-resource-manager-deserialization-mode\";\nimport { deserializeAll } from \"./shape/variant/deserialize-all\";\nimport { EShapeEmbeddedDatum } from \"./shape/variant/e-shape-embedded-datum\";\nimport { EShapeEmbeddedLayerContainer } from \"./shape/variant/e-shape-embedded-layer-container\";\n\nexport class DDiagrams {\n\tstatic toSimple(serialized: DDiagramSerialized): DDiagramSerializedSimple {\n\t\treturn {\n\t\t\tversion: serialized.version,\n\t\t\tid: serialized.id,\n\t\t\tname: serialized.name,\n\t\t\tlabel: serialized.label,\n\t\t\tcategory: serialized.category,\n\t\t\tsummary: serialized.summary,\n\t\t\tdescription: serialized.description,\n\t\t\tthumbnail: serialized.thumbnail,\n\t\t\tdata: JSON.stringify({\n\t\t\t\twidth: serialized.width,\n\t\t\t\theight: serialized.height,\n\t\t\t\tbackground: serialized.background,\n\t\t\t\ttile: serialized.tile,\n\t\t\t\tresources: serialized.resources,\n\t\t\t\tdata: serialized.data || serialized.tags,\n\t\t\t\tpieces: serialized.pieces,\n\t\t\t\tlayers: serialized.layers,\n\t\t\t\titems: serialized.items,\n\t\t\t\tsnap: serialized.snap\n\t\t\t})\n\t\t};\n\t}\n\n\tstatic toSerialized(target: DDiagramSerializedSimple | DDiagramSerialized): DDiagramSerialized {\n\t\tif (!(\"items\" in target)) {\n\t\t\tconst data: DDiagramSerializedSimpleData = JSON.parse(target.data);\n\t\t\tconst result: DDiagramSerialized = {\n\t\t\t\tversion: target.version,\n\t\t\t\tid: target.id,\n\t\t\t\tname: target.name,\n\t\t\t\tlabel: target.label,\n\t\t\t\twidth: data.width,\n\t\t\t\theight: data.height,\n\t\t\t\tcategory: target.category,\n\t\t\t\tsummary: target.summary,\n\t\t\t\tdescription: target.description,\n\t\t\t\tbackground: data.background,\n\t\t\t\ttile: data.tile,\n\t\t\t\tresources: data.resources,\n\t\t\t\tdata: data.data || data.tags,\n\t\t\t\tpieces: data.pieces,\n\t\t\t\tlayers: data.layers,\n\t\t\t\titems: data.items,\n\t\t\t\tsnap: data.snap,\n\t\t\t\tthumbnail: target.thumbnail\n\t\t\t};\n\t\t\tif (result.data == null) {\n\t\t\t\tconst tags = target.tags;\n\t\t\t\tif (tags != null) {\n\t\t\t\t\tresult.data = JSON.parse(tags);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (result.pieces == null) {\n\t\t\t\tconst pieces = target.pieces;\n\t\t\t\tif (pieces != null) {\n\t\t\t\t\tresult.pieces = JSON.parse(pieces);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\treturn target;\n\t}\n\n\tstatic newLayer(\n\t\tserialized: DDiagramSerialized,\n\t\tcontainer: DDiagramLayerContainer | EShapeLayerContainer,\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): Promise<EShape[]> {\n\t\t// Layers\n\t\tcontainer.deserialize(serialized.layers, manager);\n\n\t\t// Items\n\t\tconst serializedItems = serialized.items;\n\t\tconst shapePromises = deserializeAll(serializedItems, manager);\n\t\tif (shapePromises != null) {\n\t\t\treturn shapePromises.then((shapes: EShape[]): EShape[] => {\n\t\t\t\tconst layers = container.children;\n\t\t\t\tfor (let i = 0, imax = shapes.length; i < imax; ++i) {\n\t\t\t\t\tconst serializedItem = serializedItems[i];\n\t\t\t\t\tconst shape = shapes[i];\n\t\t\t\t\tconst layer = layers[serializedItem[16]];\n\t\t\t\t\tif (layer != null) {\n\t\t\t\t\t\tshape.parent = layer;\n\t\t\t\t\t\tshape.uploaded = undefined;\n\t\t\t\t\t\tlayer.children.push(shape);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (let i = 0, imax = layers.length; i < imax; ++i) {\n\t\t\t\t\tconst layer = layers[i];\n\t\t\t\t\tlayer.onChildTransformChange();\n\t\t\t\t\tlayer.toDirty();\n\t\t\t\t\tconst children = layer.children;\n\t\t\t\t\tfor (let j = 0, jmax = children.length; j < jmax; ++j) {\n\t\t\t\t\t\tchildren[j].onAttach();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn shapes;\n\t\t\t});\n\t\t} else {\n\t\t\treturn Promise.resolve([]);\n\t\t}\n\t}\n\n\tstatic toPieceData(\n\t\tcontroller: DDiagramBaseController | null | undefined,\n\t\tpieces: string[] | null | undefined,\n\t\tmode: EShapeResourceManagerDeserializationMode\n\t): Promise<Map<string, EShapeEmbeddedDatum | null>> {\n\t\tconst pieceToDatum = new Map<string, EShapeEmbeddedDatum | null>();\n\t\tconst pieceToPromise = new Map<string, Promise<EShape[] | null>>();\n\t\tconst onFulfilled = () => {\n\t\t\treturn pieceToDatum;\n\t\t};\n\t\treturn this.toPieceData_(controller, pieces, pieceToDatum, pieceToPromise, mode, 0).then(\n\t\t\tonFulfilled,\n\t\t\tonFulfilled\n\t\t);\n\t}\n\n\tprivate static toPieceData_(\n\t\tcontroller: DDiagramBaseController | null | undefined,\n\t\tpieces: string[] | null | undefined,\n\t\tpieceToDatum: Map<string, EShapeEmbeddedDatum | null>,\n\t\tpieceToPromise: Map<string, Promise<EShape[] | null>>,\n\t\tmode: EShapeResourceManagerDeserializationMode,\n\t\tdepth: number\n\t): Promise<Array<EShape[] | null>> {\n\t\tconst promises: Array<Promise<EShape[] | null>> = [];\n\t\tif (pieces && 0 < pieces.length && controller) {\n\t\t\tfor (let i = 0, imax = pieces.length; i < imax; ++i) {\n\t\t\t\tconst piece = pieces[i];\n\t\t\t\tconst promise = pieceToPromise.get(piece);\n\t\t\t\tif (promise != null) {\n\t\t\t\t\tpromises.push(promise);\n\t\t\t\t} else {\n\t\t\t\t\tconst newPromise = controller.piece.getByName(piece).then(\n\t\t\t\t\t\t(found) => {\n\t\t\t\t\t\t\treturn this.toPieceData__(\n\t\t\t\t\t\t\t\tcontroller,\n\t\t\t\t\t\t\t\tpiece,\n\t\t\t\t\t\t\t\tfound,\n\t\t\t\t\t\t\t\tmode,\n\t\t\t\t\t\t\t\tdepth + 1,\n\t\t\t\t\t\t\t\tpieceToDatum,\n\t\t\t\t\t\t\t\tpieceToPromise\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tpieceToPromise.set(piece, newPromise);\n\t\t\t\t\tpromises.push(newPromise);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Promise.all(promises);\n\t}\n\n\tprivate static toPieceData__(\n\t\tcontroller: DDiagramBaseController,\n\t\tname: string,\n\t\tserializedOrSimple: DDiagramSerialized | DDiagramSerializedSimple,\n\t\tmode: EShapeResourceManagerDeserializationMode,\n\t\tdepth: number,\n\t\tpieceToDatum: Map<string, EShapeEmbeddedDatum | null>,\n\t\tpieceToPromise: Map<string, Promise<EShape[] | null>>\n\t): Promise<EShape[]> {\n\t\tconst serialized = this.toSerialized(serializedOrSimple);\n\t\tconst width = serialized.width;\n\t\tconst height = serialized.height;\n\t\tconst container = new EShapeEmbeddedLayerContainer(width, height);\n\n\t\tpieceToDatum.set(name, new EShapeEmbeddedDatum(name, width, height, container));\n\n\t\tconst pieces = serialized.pieces;\n\t\treturn this.toPieceData_(\n\t\t\tcontroller,\n\t\t\tpieces,\n\t\t\tpieceToDatum,\n\t\t\tpieceToPromise,\n\t\t\tmode,\n\t\t\tdepth\n\t\t).then(() => {\n\t\t\treturn this.newLayer(\n\t\t\t\tserialized,\n\t\t\t\tcontainer,\n\t\t\t\tnew EShapeResourceManagerDeserialization(\n\t\t\t\t\tserialized,\n\t\t\t\t\tpieces,\n\t\t\t\t\tpieceToDatum,\n\t\t\t\t\tmode,\n\t\t\t\t\tdepth\n\t\t\t\t)\n\t\t\t);\n\t\t});\n\t}\n}\n"]}
|
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.357.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -22701,6 +22701,7 @@ var DDiagrams = /** @class */ (function () {
|
|
|
22701
22701
|
id: serialized.id,
|
|
22702
22702
|
name: serialized.name,
|
|
22703
22703
|
label: serialized.label,
|
|
22704
|
+
category: serialized.category,
|
|
22704
22705
|
summary: serialized.summary,
|
|
22705
22706
|
description: serialized.description,
|
|
22706
22707
|
thumbnail: serialized.thumbnail,
|
|
@@ -22728,6 +22729,7 @@ var DDiagrams = /** @class */ (function () {
|
|
|
22728
22729
|
label: target.label,
|
|
22729
22730
|
width: data.width,
|
|
22730
22731
|
height: data.height,
|
|
22732
|
+
category: target.category,
|
|
22731
22733
|
summary: target.summary,
|
|
22732
22734
|
description: target.description,
|
|
22733
22735
|
background: data.background,
|
|
@@ -81182,7 +81184,7 @@ var DDiagramCanvasBase = /** @class */ (function (_super) {
|
|
|
81182
81184
|
__extends(DDiagramCanvasBase, _super);
|
|
81183
81185
|
function DDiagramCanvasBase(options) {
|
|
81184
81186
|
var _this = this;
|
|
81185
|
-
var _a, _b, _c;
|
|
81187
|
+
var _a, _b, _c, _d;
|
|
81186
81188
|
_this = _super.call(this, options) || this;
|
|
81187
81189
|
// Background
|
|
81188
81190
|
var theme = _this.theme;
|
|
@@ -81193,12 +81195,19 @@ var DDiagramCanvasBase = /** @class */ (function (_super) {
|
|
|
81193
81195
|
var layer = new DDiagramLayerContainer(_this.width, _this.height);
|
|
81194
81196
|
_this._layer = layer;
|
|
81195
81197
|
_this.addChild(layer);
|
|
81196
|
-
// Label
|
|
81197
|
-
|
|
81198
|
-
|
|
81199
|
-
|
|
81200
|
-
|
|
81201
|
-
|
|
81198
|
+
// Label, Category, Summary and Description
|
|
81199
|
+
if (options != null) {
|
|
81200
|
+
_this._label = (_a = options.label) !== null && _a !== void 0 ? _a : "";
|
|
81201
|
+
_this._category = (_b = options.category) !== null && _b !== void 0 ? _b : "";
|
|
81202
|
+
_this._summary = (_c = options.summary) !== null && _c !== void 0 ? _c : "";
|
|
81203
|
+
_this._description = (_d = options.description) !== null && _d !== void 0 ? _d : "";
|
|
81204
|
+
}
|
|
81205
|
+
else {
|
|
81206
|
+
_this._label = "";
|
|
81207
|
+
_this._category = "";
|
|
81208
|
+
_this._summary = "";
|
|
81209
|
+
_this._description = "";
|
|
81210
|
+
}
|
|
81202
81211
|
// Tile
|
|
81203
81212
|
var tile = new DDiagramCanvasTile(_this, options === null || options === void 0 ? void 0 : options.tile);
|
|
81204
81213
|
_this._tile = tile;
|
|
@@ -81223,6 +81232,16 @@ var DDiagramCanvasBase = /** @class */ (function (_super) {
|
|
|
81223
81232
|
enumerable: false,
|
|
81224
81233
|
configurable: true
|
|
81225
81234
|
});
|
|
81235
|
+
Object.defineProperty(DDiagramCanvasBase.prototype, "category", {
|
|
81236
|
+
get: function () {
|
|
81237
|
+
return this._category;
|
|
81238
|
+
},
|
|
81239
|
+
set: function (category) {
|
|
81240
|
+
this._category = category;
|
|
81241
|
+
},
|
|
81242
|
+
enumerable: false,
|
|
81243
|
+
configurable: true
|
|
81244
|
+
});
|
|
81226
81245
|
Object.defineProperty(DDiagramCanvasBase.prototype, "summary", {
|
|
81227
81246
|
get: function () {
|
|
81228
81247
|
return this._summary;
|
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.357.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -22698,6 +22698,7 @@
|
|
|
22698
22698
|
id: serialized.id,
|
|
22699
22699
|
name: serialized.name,
|
|
22700
22700
|
label: serialized.label,
|
|
22701
|
+
category: serialized.category,
|
|
22701
22702
|
summary: serialized.summary,
|
|
22702
22703
|
description: serialized.description,
|
|
22703
22704
|
thumbnail: serialized.thumbnail,
|
|
@@ -22725,6 +22726,7 @@
|
|
|
22725
22726
|
label: target.label,
|
|
22726
22727
|
width: data.width,
|
|
22727
22728
|
height: data.height,
|
|
22729
|
+
category: target.category,
|
|
22728
22730
|
summary: target.summary,
|
|
22729
22731
|
description: target.description,
|
|
22730
22732
|
background: data.background,
|
|
@@ -62626,7 +62628,7 @@
|
|
|
62626
62628
|
__extends(DDiagramCanvasBase, _super);
|
|
62627
62629
|
function DDiagramCanvasBase(options) {
|
|
62628
62630
|
var _this = this;
|
|
62629
|
-
var _a, _b, _c;
|
|
62631
|
+
var _a, _b, _c, _d;
|
|
62630
62632
|
_this = _super.call(this, options) || this;
|
|
62631
62633
|
// Background
|
|
62632
62634
|
var theme = _this.theme;
|
|
@@ -62637,12 +62639,19 @@
|
|
|
62637
62639
|
var layer = new DDiagramLayerContainer(_this.width, _this.height);
|
|
62638
62640
|
_this._layer = layer;
|
|
62639
62641
|
_this.addChild(layer);
|
|
62640
|
-
// Label
|
|
62641
|
-
|
|
62642
|
-
|
|
62643
|
-
|
|
62644
|
-
|
|
62645
|
-
|
|
62642
|
+
// Label, Category, Summary and Description
|
|
62643
|
+
if (options != null) {
|
|
62644
|
+
_this._label = (_a = options.label) !== null && _a !== void 0 ? _a : "";
|
|
62645
|
+
_this._category = (_b = options.category) !== null && _b !== void 0 ? _b : "";
|
|
62646
|
+
_this._summary = (_c = options.summary) !== null && _c !== void 0 ? _c : "";
|
|
62647
|
+
_this._description = (_d = options.description) !== null && _d !== void 0 ? _d : "";
|
|
62648
|
+
}
|
|
62649
|
+
else {
|
|
62650
|
+
_this._label = "";
|
|
62651
|
+
_this._category = "";
|
|
62652
|
+
_this._summary = "";
|
|
62653
|
+
_this._description = "";
|
|
62654
|
+
}
|
|
62646
62655
|
// Tile
|
|
62647
62656
|
var tile = new DDiagramCanvasTile(_this, options === null || options === void 0 ? void 0 : options.tile);
|
|
62648
62657
|
_this._tile = tile;
|
|
@@ -62667,6 +62676,16 @@
|
|
|
62667
62676
|
enumerable: false,
|
|
62668
62677
|
configurable: true
|
|
62669
62678
|
});
|
|
62679
|
+
Object.defineProperty(DDiagramCanvasBase.prototype, "category", {
|
|
62680
|
+
get: function () {
|
|
62681
|
+
return this._category;
|
|
62682
|
+
},
|
|
62683
|
+
set: function (category) {
|
|
62684
|
+
this._category = category;
|
|
62685
|
+
},
|
|
62686
|
+
enumerable: false,
|
|
62687
|
+
configurable: true
|
|
62688
|
+
});
|
|
62670
62689
|
Object.defineProperty(DDiagramCanvasBase.prototype, "summary", {
|
|
62671
62690
|
get: function () {
|
|
62672
62691
|
return this._summary;
|