@wcardinal/wcardinal-ui 0.155.0 → 0.158.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-application-layer-like.d.ts +0 -1
- package/dist/types/wcardinal/ui/d-application-layer.d.ts +0 -2
- package/dist/types/wcardinal/ui/d-base.d.ts +11 -12
- package/dist/types/wcardinal/ui/d-diagram-snapshot.d.ts +0 -2
- package/dist/types/wcardinal/ui/d-image-base.d.ts +2 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-bottom.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-center.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-container.d.ts +25 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-left.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-middle.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-right.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-top.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter.d.ts +17 -0
- package/dist/types/wcardinal/ui/d-menu-sided.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-text-base.d.ts +5 -5
- package/dist/types/wcardinal/ui/shape/variant/deserialize-connector-line.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-line.d.ts +1 -1
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-input.d.ts +1 -1
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-input.d.ts +1 -1
- package/dist/wcardinal/ui/d-application-layer-like.js.map +1 -1
- package/dist/wcardinal/ui/d-application-layer.js +3 -21
- package/dist/wcardinal/ui/d-application-layer.js.map +1 -1
- package/dist/wcardinal/ui/d-base.js +126 -100
- package/dist/wcardinal/ui/d-base.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-snapshot.js +2 -18
- package/dist/wcardinal/ui/d-diagram-snapshot.js.map +1 -1
- package/dist/wcardinal/ui/d-html-element.js +0 -3
- package/dist/wcardinal/ui/d-html-element.js.map +1 -1
- package/dist/wcardinal/ui/d-image-base.js +9 -264
- package/dist/wcardinal/ui/d-image-base.js.map +1 -1
- package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js +31 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js +24 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js +158 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js +30 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js +24 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js +31 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js +32 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part.js +18 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter.js +65 -0
- package/dist/wcardinal/ui/d-image-piece-layouter.js.map +1 -0
- package/dist/wcardinal/ui/d-menu-item-text.js +18 -2
- package/dist/wcardinal/ui/d-menu-item-text.js.map +1 -1
- package/dist/wcardinal/ui/d-menu-sided.js +2 -2
- package/dist/wcardinal/ui/d-menu-sided.js.map +1 -1
- package/dist/wcardinal/ui/d-picker-color-gradient.js +6 -6
- package/dist/wcardinal/ui/d-picker-color-gradient.js.map +1 -1
- package/dist/wcardinal/ui/d-text-base.js +34 -24
- package/dist/wcardinal/ui/d-text-base.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-connector-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js +30 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-line.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js +2 -2
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-input.js +2 -2
- package/dist/wcardinal/ui/theme/white/d-theme-white-input.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js +3 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +3 -3
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +3 -3
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
- package/dist/wcardinal-ui.cjs.js +785 -611
- package/dist/wcardinal-ui.js +781 -607
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { DImagePieceLayouterPart } from "./d-image-piece-layouter-part";
|
|
3
|
+
var DImagePieceLayouterPartLeft = /** @class */ (function (_super) {
|
|
4
|
+
__extends(DImagePieceLayouterPartLeft, _super);
|
|
5
|
+
function DImagePieceLayouterPartLeft() {
|
|
6
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7
|
+
}
|
|
8
|
+
DImagePieceLayouterPartLeft.prototype.execute = function (pleft, marginAfter) {
|
|
9
|
+
var pieces = this.pieces;
|
|
10
|
+
var x = pleft;
|
|
11
|
+
if (marginAfter) {
|
|
12
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
13
|
+
var piece = pieces[i];
|
|
14
|
+
piece.image.x = x;
|
|
15
|
+
x += piece.bound.width + piece.margin.horizontal;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
20
|
+
var piece = pieces[i];
|
|
21
|
+
x += piece.margin.horizontal;
|
|
22
|
+
piece.image.x = x;
|
|
23
|
+
x += piece.bound.width;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return DImagePieceLayouterPartLeft;
|
|
28
|
+
}(DImagePieceLayouterPart));
|
|
29
|
+
export { DImagePieceLayouterPartLeft };
|
|
30
|
+
//# sourceMappingURL=d-image-piece-layouter-part-left.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d-image-piece-layouter-part-left.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-layouter-part-left.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE;IAAiD,+CAAuB;IAAxE;;IAmBA,CAAC;IAlBA,6CAAO,GAAP,UAAQ,KAAa,EAAE,WAAoB;QAC1C,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,GAAG,KAAK,CAAC;QACd,IAAI,WAAW,EAAE;YAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;gBACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,CAAC;gBACnB,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;aACjD;SACD;aAAM;YACN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;gBACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;gBAC7B,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,CAAC;gBACnB,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;aACvB;SACD;IACF,CAAC;IACF,kCAAC;AAAD,CAAC,AAnBD,CAAiD,uBAAuB,GAmBvE","sourcesContent":["import { DImagePieceLayouterPart } from \"./d-image-piece-layouter-part\";\n\nexport class DImagePieceLayouterPartLeft extends DImagePieceLayouterPart {\n\texecute(pleft: number, marginAfter: boolean): void {\n\t\tconst pieces = this.pieces;\n\t\tlet x = pleft;\n\t\tif (marginAfter) {\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\tpiece.image!.x = x;\n\t\t\t\tx += piece.bound.width + piece.margin.horizontal;\n\t\t\t}\n\t\t} else {\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\tx += piece.margin.horizontal;\n\t\t\t\tpiece.image!.x = x;\n\t\t\t\tx += piece.bound.width;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { DImagePieceLayouterPart } from "./d-image-piece-layouter-part";
|
|
3
|
+
var DImagePieceLayouterPartMiddle = /** @class */ (function (_super) {
|
|
4
|
+
__extends(DImagePieceLayouterPartMiddle, _super);
|
|
5
|
+
function DImagePieceLayouterPartMiddle() {
|
|
6
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7
|
+
}
|
|
8
|
+
DImagePieceLayouterPartMiddle.prototype.add = function (image, size, margin) {
|
|
9
|
+
var pieces = this.pieces;
|
|
10
|
+
pieces.push(image);
|
|
11
|
+
this.size = Math.max(this.size, size);
|
|
12
|
+
};
|
|
13
|
+
DImagePieceLayouterPartMiddle.prototype.execute = function (ptop, pbottom, height) {
|
|
14
|
+
var c = ptop + (height - ptop - pbottom) * 0.5;
|
|
15
|
+
var pieces = this.pieces;
|
|
16
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
17
|
+
var piece = pieces[i];
|
|
18
|
+
piece.image.y = c - piece.bound.height * 0.5;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return DImagePieceLayouterPartMiddle;
|
|
22
|
+
}(DImagePieceLayouterPart));
|
|
23
|
+
export { DImagePieceLayouterPartMiddle };
|
|
24
|
+
//# sourceMappingURL=d-image-piece-layouter-part-middle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d-image-piece-layouter-part-middle.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-layouter-part-middle.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE;IAAmD,iDAAuB;IAA1E;;IAeA,CAAC;IAdA,2CAAG,GAAH,UAAI,KAAkB,EAAE,IAAY,EAAE,MAAc;QACnD,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,+CAAO,GAAP,UAAQ,IAAY,EAAE,OAAe,EAAE,MAAc;QACpD,IAAM,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,CAAC;QACjD,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;SAC9C;IACF,CAAC;IACF,oCAAC;AAAD,CAAC,AAfD,CAAmD,uBAAuB,GAezE","sourcesContent":["import { DImagePiece } from \"./d-image-piece\";\nimport { DImagePieceLayouterPart } from \"./d-image-piece-layouter-part\";\n\nexport class DImagePieceLayouterPartMiddle extends DImagePieceLayouterPart {\n\tadd(image: DImagePiece, size: number, margin: number): void {\n\t\tconst pieces = this.pieces;\n\t\tpieces.push(image);\n\t\tthis.size = Math.max(this.size, size);\n\t}\n\n\texecute(ptop: number, pbottom: number, height: number): void {\n\t\tconst c = ptop + (height - ptop - pbottom) * 0.5;\n\t\tconst pieces = this.pieces;\n\t\tfor (let i = 0, imax = pieces.length; i < imax; ++i) {\n\t\t\tconst piece = pieces[i];\n\t\t\tpiece.image!.y = c - piece.bound.height * 0.5;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { DImagePieceLayouterPart } from "./d-image-piece-layouter-part";
|
|
3
|
+
var DImagePieceLayouterPartRight = /** @class */ (function (_super) {
|
|
4
|
+
__extends(DImagePieceLayouterPartRight, _super);
|
|
5
|
+
function DImagePieceLayouterPartRight() {
|
|
6
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7
|
+
}
|
|
8
|
+
DImagePieceLayouterPartRight.prototype.execute = function (pright, width, marginAfter) {
|
|
9
|
+
var pieces = this.pieces;
|
|
10
|
+
var x = width - pright;
|
|
11
|
+
if (marginAfter) {
|
|
12
|
+
var margin = 0;
|
|
13
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
14
|
+
var piece = pieces[i];
|
|
15
|
+
x -= margin + piece.bound.width;
|
|
16
|
+
piece.image.x = x;
|
|
17
|
+
margin = piece.margin.horizontal;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
22
|
+
var piece = pieces[i];
|
|
23
|
+
x -= piece.margin.horizontal + piece.bound.width;
|
|
24
|
+
piece.image.x = x;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return DImagePieceLayouterPartRight;
|
|
29
|
+
}(DImagePieceLayouterPart));
|
|
30
|
+
export { DImagePieceLayouterPartRight };
|
|
31
|
+
//# sourceMappingURL=d-image-piece-layouter-part-right.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d-image-piece-layouter-part-right.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-layouter-part-right.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE;IAAkD,gDAAuB;IAAzE;;IAoBA,CAAC;IAnBA,8CAAO,GAAP,UAAQ,MAAc,EAAE,KAAa,EAAE,WAAoB;QAC1D,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,GAAG,KAAK,GAAG,MAAM,CAAC;QACvB,IAAI,WAAW,EAAE;YAChB,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;gBACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC,IAAI,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;gBAChC,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,CAAC;gBACnB,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;aACjC;SACD;aAAM;YACN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;gBACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;gBACjD,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,CAAC;aACnB;SACD;IACF,CAAC;IACF,mCAAC;AAAD,CAAC,AApBD,CAAkD,uBAAuB,GAoBxE","sourcesContent":["import { DImagePieceLayouterPart } from \"./d-image-piece-layouter-part\";\n\nexport class DImagePieceLayouterPartRight extends DImagePieceLayouterPart {\n\texecute(pright: number, width: number, marginAfter: boolean): void {\n\t\tconst pieces = this.pieces;\n\t\tlet x = width - pright;\n\t\tif (marginAfter) {\n\t\t\tlet margin = 0;\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\tx -= margin + piece.bound.width;\n\t\t\t\tpiece.image!.x = x;\n\t\t\t\tmargin = piece.margin.horizontal;\n\t\t\t}\n\t\t} else {\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\tx -= piece.margin.horizontal + piece.bound.width;\n\t\t\t\tpiece.image!.x = x;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { DImagePieceLayouterPart } from "./d-image-piece-layouter-part";
|
|
3
|
+
var DImagePieceLayouterPartTop = /** @class */ (function (_super) {
|
|
4
|
+
__extends(DImagePieceLayouterPartTop, _super);
|
|
5
|
+
function DImagePieceLayouterPartTop() {
|
|
6
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7
|
+
}
|
|
8
|
+
DImagePieceLayouterPartTop.prototype.execute = function (ptop, marginAfter) {
|
|
9
|
+
var pieces = this.pieces;
|
|
10
|
+
var y = ptop;
|
|
11
|
+
if (marginAfter) {
|
|
12
|
+
var margin = 0;
|
|
13
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
14
|
+
var piece = pieces[i];
|
|
15
|
+
piece.image.y = margin + y;
|
|
16
|
+
y += piece.bound.height;
|
|
17
|
+
margin = piece.margin.vertical;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
22
|
+
var piece = pieces[i];
|
|
23
|
+
y += piece.margin.vertical;
|
|
24
|
+
piece.image.y = y;
|
|
25
|
+
y += piece.bound.height;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return DImagePieceLayouterPartTop;
|
|
30
|
+
}(DImagePieceLayouterPart));
|
|
31
|
+
export { DImagePieceLayouterPartTop };
|
|
32
|
+
//# sourceMappingURL=d-image-piece-layouter-part-top.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d-image-piece-layouter-part-top.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-layouter-part-top.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE;IAAgD,8CAAuB;IAAvE;;IAqBA,CAAC;IApBA,4CAAO,GAAP,UAAQ,IAAY,EAAE,WAAoB;QACzC,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,GAAG,IAAI,CAAC;QACb,IAAI,WAAW,EAAE;YAChB,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;gBACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;gBAC5B,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;gBACxB,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;aAC/B;SACD;aAAM;YACN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;gBACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;gBAC3B,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,CAAC;gBACnB,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;aACxB;SACD;IACF,CAAC;IACF,iCAAC;AAAD,CAAC,AArBD,CAAgD,uBAAuB,GAqBtE","sourcesContent":["import { DImagePieceLayouterPart } from \"./d-image-piece-layouter-part\";\n\nexport class DImagePieceLayouterPartTop extends DImagePieceLayouterPart {\n\texecute(ptop: number, marginAfter: boolean): void {\n\t\tconst pieces = this.pieces;\n\t\tlet y = ptop;\n\t\tif (marginAfter) {\n\t\t\tlet margin = 0;\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\tpiece.image!.y = margin + y;\n\t\t\t\ty += piece.bound.height;\n\t\t\t\tmargin = piece.margin.vertical;\n\t\t\t}\n\t\t} else {\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\ty += piece.margin.vertical;\n\t\t\t\tpiece.image!.y = y;\n\t\t\t\ty += piece.bound.height;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var DImagePieceLayouterPart = /** @class */ (function () {
|
|
2
|
+
function DImagePieceLayouterPart() {
|
|
3
|
+
this.pieces = [];
|
|
4
|
+
this.size = 0;
|
|
5
|
+
}
|
|
6
|
+
DImagePieceLayouterPart.prototype.clear = function () {
|
|
7
|
+
this.pieces.length = 0;
|
|
8
|
+
this.size = 0;
|
|
9
|
+
};
|
|
10
|
+
DImagePieceLayouterPart.prototype.add = function (image, size, margin) {
|
|
11
|
+
var pieces = this.pieces;
|
|
12
|
+
pieces.push(image);
|
|
13
|
+
this.size += margin + size;
|
|
14
|
+
};
|
|
15
|
+
return DImagePieceLayouterPart;
|
|
16
|
+
}());
|
|
17
|
+
export { DImagePieceLayouterPart };
|
|
18
|
+
//# sourceMappingURL=d-image-piece-layouter-part.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d-image-piece-layouter-part.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-layouter-part.ts"],"names":[],"mappings":"AAEA;IAIC;QACC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IACf,CAAC;IAED,uCAAK,GAAL;QACC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IACf,CAAC;IAED,qCAAG,GAAH,UAAI,KAAkB,EAAE,IAAY,EAAE,MAAc;QACnD,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,IAAI,MAAM,GAAG,IAAI,CAAC;IAC5B,CAAC;IACF,8BAAC;AAAD,CAAC,AAnBD,IAmBC","sourcesContent":["import { DImagePiece } from \"./d-image-piece\";\n\nexport class DImagePieceLayouterPart {\n\tpieces: DImagePiece[];\n\tsize: number;\n\n\tconstructor() {\n\t\tthis.pieces = [];\n\t\tthis.size = 0;\n\t}\n\n\tclear(): void {\n\t\tthis.pieces.length = 0;\n\t\tthis.size = 0;\n\t}\n\n\tadd(image: DImagePiece, size: number, margin: number): void {\n\t\tconst pieces = this.pieces;\n\t\tpieces.push(image);\n\t\tthis.size += margin + size;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { DAlignWith } from "./d-align-with";
|
|
2
|
+
import { DImagePieceLayouterPartContainer } from "./d-image-piece-layouter-part-container";
|
|
3
|
+
var DImagePieceLayouter = /** @class */ (function () {
|
|
4
|
+
function DImagePieceLayouter() {
|
|
5
|
+
this.text = new DImagePieceLayouterPartContainer();
|
|
6
|
+
this.padding = new DImagePieceLayouterPartContainer();
|
|
7
|
+
this.border = new DImagePieceLayouterPartContainer();
|
|
8
|
+
}
|
|
9
|
+
DImagePieceLayouter.prototype.clear = function () {
|
|
10
|
+
this.text.clear();
|
|
11
|
+
this.padding.clear();
|
|
12
|
+
this.border.clear();
|
|
13
|
+
};
|
|
14
|
+
DImagePieceLayouter.prototype.add = function (image) {
|
|
15
|
+
var imageImage = image.image;
|
|
16
|
+
if (imageImage) {
|
|
17
|
+
switch (image.align.with) {
|
|
18
|
+
case DAlignWith.TEXT:
|
|
19
|
+
this.text.add(image);
|
|
20
|
+
break;
|
|
21
|
+
case DAlignWith.PADDING:
|
|
22
|
+
this.padding.add(image);
|
|
23
|
+
break;
|
|
24
|
+
case DAlignWith.BORDER:
|
|
25
|
+
this.border.add(image);
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
DImagePieceLayouter.prototype.set = function (text) {
|
|
31
|
+
this.text.set(text);
|
|
32
|
+
};
|
|
33
|
+
DImagePieceLayouter.prototype.execute = function (padding, textAlign, width, height) {
|
|
34
|
+
var pleft = padding.getLeft();
|
|
35
|
+
var ptop = padding.getTop();
|
|
36
|
+
var pright = padding.getRight();
|
|
37
|
+
var pbottom = padding.getBottom();
|
|
38
|
+
if (width == null) {
|
|
39
|
+
width = pleft + this.width + pright;
|
|
40
|
+
}
|
|
41
|
+
if (height == null) {
|
|
42
|
+
height = ptop + this.height + pbottom;
|
|
43
|
+
}
|
|
44
|
+
this.border.execute(0, 0, 0, 0, textAlign, width, height);
|
|
45
|
+
this.padding.execute(pleft, ptop, pright, pbottom, textAlign, width, height);
|
|
46
|
+
this.text.execute(pleft, ptop, pright, pbottom, textAlign, width, height);
|
|
47
|
+
};
|
|
48
|
+
Object.defineProperty(DImagePieceLayouter.prototype, "width", {
|
|
49
|
+
get: function () {
|
|
50
|
+
return Math.max(this.border.width, this.padding.width, this.text.width);
|
|
51
|
+
},
|
|
52
|
+
enumerable: false,
|
|
53
|
+
configurable: true
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(DImagePieceLayouter.prototype, "height", {
|
|
56
|
+
get: function () {
|
|
57
|
+
return Math.max(this.border.height, this.padding.height, this.text.height);
|
|
58
|
+
},
|
|
59
|
+
enumerable: false,
|
|
60
|
+
configurable: true
|
|
61
|
+
});
|
|
62
|
+
return DImagePieceLayouter;
|
|
63
|
+
}());
|
|
64
|
+
export { DImagePieceLayouter };
|
|
65
|
+
//# sourceMappingURL=d-image-piece-layouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d-image-piece-layouter.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-layouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB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AC,QAAQ,EAAE,CAAC;QAClC,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;QACpC,IAAI,KAAK,IAAI,IAAI,EAAE;YAClB,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;SACpC;QACD,IAAI,MAAM,IAAI,IAAI,EAAE;YACnB,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;SACtC;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC1D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC7E,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC;IAED,sBAAI,sCAAK;aAAT;YACC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzE,CAAC;;;OAAA;IAED,sBAAI,uCAAM;aAAV;YACC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5E,CAAC;;;OAAA;IACF,0BAAC;AAAD,CAAC,AAlED,IAkEC","sourcesContent":["import { DAlignWith } from \"./d-align-with\";\nimport { DDynamicText } from \"./d-dynamic-text\";\nimport { DImagePiece } from \"./d-image-piece\";\nimport { DImagePieceLayouterPartContainer } from \"./d-image-piece-layouter-part-container\";\nimport { DPadding } from \"./d-padding\";\nimport { DTextBaseAlign } from \"./d-text-base\";\n\nexport class DImagePieceLayouter {\n\ttext: DImagePieceLayouterPartContainer;\n\tpadding: DImagePieceLayouterPartContainer;\n\tborder: DImagePieceLayouterPartContainer;\n\n\tconstructor() {\n\t\tthis.text = new DImagePieceLayouterPartContainer();\n\t\tthis.padding = new DImagePieceLayouterPartContainer();\n\t\tthis.border = new DImagePieceLayouterPartContainer();\n\t}\n\n\tclear(): void {\n\t\tthis.text.clear();\n\t\tthis.padding.clear();\n\t\tthis.border.clear();\n\t}\n\n\tadd(image: DImagePiece): void {\n\t\tconst imageImage = image.image;\n\t\tif (imageImage) {\n\t\t\tswitch (image.align.with) {\n\t\t\t\tcase DAlignWith.TEXT:\n\t\t\t\t\tthis.text.add(image);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignWith.PADDING:\n\t\t\t\t\tthis.padding.add(image);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignWith.BORDER:\n\t\t\t\t\tthis.border.add(image);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tset(text: DDynamicText): void {\n\t\tthis.text.set(text);\n\t}\n\n\texecute(\n\t\tpadding: DPadding,\n\t\ttextAlign: DTextBaseAlign,\n\t\twidth: number | null,\n\t\theight: number | null\n\t): void {\n\t\tconst pleft = padding.getLeft();\n\t\tconst ptop = padding.getTop();\n\t\tconst pright = padding.getRight();\n\t\tconst pbottom = padding.getBottom();\n\t\tif (width == null) {\n\t\t\twidth = pleft + this.width + pright;\n\t\t}\n\t\tif (height == null) {\n\t\t\theight = ptop + this.height + pbottom;\n\t\t}\n\t\tthis.border.execute(0, 0, 0, 0, textAlign, width, height);\n\t\tthis.padding.execute(pleft, ptop, pright, pbottom, textAlign, width, height);\n\t\tthis.text.execute(pleft, ptop, pright, pbottom, textAlign, width, height);\n\t}\n\n\tget width(): number {\n\t\treturn Math.max(this.border.width, this.padding.width, this.text.width);\n\t}\n\n\tget height(): number {\n\t\treturn Math.max(this.border.height, this.padding.height, this.text.height);\n\t}\n}\n"]}
|
|
@@ -46,8 +46,24 @@ var DMenuItemText = /** @class */ (function (_super) {
|
|
|
46
46
|
var text = this._shortcutText;
|
|
47
47
|
var margin = this._shortcutMargin;
|
|
48
48
|
if (text != null && margin != null) {
|
|
49
|
-
var
|
|
50
|
-
|
|
49
|
+
var auto = this._auto;
|
|
50
|
+
var textX = 0;
|
|
51
|
+
if (auto.width.isOn) {
|
|
52
|
+
textX = margin;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
textX = this.width - text.width - margin;
|
|
56
|
+
}
|
|
57
|
+
var textY = 0;
|
|
58
|
+
var padding = this._padding;
|
|
59
|
+
var ptop = padding.getTop();
|
|
60
|
+
if (auto.height.isOn) {
|
|
61
|
+
textY = ptop;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
textY = ptop + (this.height - ptop - padding.getBottom() - text.height) * 0.5;
|
|
65
|
+
}
|
|
66
|
+
text.position.set(textX, textY);
|
|
51
67
|
}
|
|
52
68
|
};
|
|
53
69
|
DMenuItemText.prototype.updateTextColor = function (text) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-menu-item-text.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-menu-item-text.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGjC,OAAO,EAAE,SAAS,EAAoC,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAa7D;IAIU,iCAAgC;IAJ1C;;
|
|
1
|
+
{"version":3,"file":"d-menu-item-text.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-menu-item-text.ts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GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,IAAI,YAAY,IAAI,IAAI,EAAE;YACzB,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACzB,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACzB,YAAY,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YACxD,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SACnD;IACF,CAAC;IAES,kCAAU,GAApB;QACC,iBAAM,UAAU,WAAE,CAAC;QACnB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC3B,CAAC;IAES,+BAAO,GAAjB;QACC,OAAO,eAAe,CAAC;IACxB,CAAC;IAES,gCAAQ,GAAlB,UAAmB,CAA+C;QACjE,iBAAM,QAAQ,YAAC,CAAC,CAAC,CAAC;QAClB,IAAM,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACtC,IAAI,SAAS,IAAI,IAAI,EAAE;YACtB,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;SACtD;IACF,CAAC;IAES,kCAAU,GAApB,UAAqB,CAAgB;QACpC,iBAAM,UAAU,YAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACF,oBAAC;AAAD,CAAC,AAnGD,CAIU,SAAS,GA+FlB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { DBaseStateSet } from \"./d-base-state-set\";\nimport { DDynamicText } from \"./d-dynamic-text\";\nimport { DMenuItem, DMenuItemOptions, DThemeMenuItem } from \"./d-menu-item\";\nimport { UtilKeyboardEvent } from \"./util/util-keyboard-event\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\n\nexport interface DMenuItemTextOptions<\n\tVALUE = unknown,\n\tTHEME extends DThemeMenuItemText = DThemeMenuItemText\n> extends DMenuItemOptions<VALUE, THEME> {}\n\nexport interface DThemeMenuItemText extends DThemeMenuItem {\n\tgetShortcutTextMargin(): number;\n\tgetShortcutColor(state: DBaseStateSet): number;\n\tgetShortcutAlpha(state: DBaseStateSet): number;\n}\n\nexport class DMenuItemText<\n\tVALUE = unknown,\n\tTHEME extends DThemeMenuItemText = DThemeMenuItemText,\n\tOPTIONS extends DMenuItemTextOptions<VALUE, THEME> = DMenuItemTextOptions<VALUE, THEME>\n> extends DMenuItem<VALUE, THEME, OPTIONS> {\n\tprotected _shortcutText?: DDynamicText | null;\n\tprotected _shortcutMargin?: number;\n\n\tprotected init(options?: OPTIONS): void {\n\t\tsuper.init(options);\n\t\tthis.initOnOver(options);\n\t\tthis.initShortcuts(options);\n\t}\n\n\tprotected initOnOver(options?: OPTIONS): void {\n\t\tthis.on(UtilPointerEvent.over, (): void => {\n\t\t\tconst context = this.getContext();\n\t\t\tif (context != null) {\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tif (parent instanceof DBase) {\n\t\t\t\t\tcontext.trim(this.getCloseable());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected initShortcuts(options?: OPTIONS): void {\n\t\tconst shortcuts = this._shortcuts;\n\t\tif (shortcuts != null && 0 < shortcuts.length) {\n\t\t\tconst shortcut = shortcuts[0];\n\t\t\tconst shortcutTextValue = UtilKeyboardEvent.toString(shortcut);\n\t\t\tthis._shortcutText = this.createText(shortcutTextValue);\n\t\t\tthis.snippet.add(this._shortcutText, true);\n\t\t} else {\n\t\t\tthis._shortcutText = null;\n\t\t}\n\n\t\tthis._shortcutMargin = this.theme.getShortcutTextMargin();\n\t}\n\n\tprotected updateShortcutText(): void {\n\t\tconst text = this._shortcutText;\n\t\tconst margin = this._shortcutMargin;\n\t\tif (text != null && margin != null) {\n\t\t\tconst auto = this._auto;\n\n\t\t\tlet textX = 0;\n\t\t\tif (auto.width.isOn) {\n\t\t\t\ttextX = margin;\n\t\t\t} else {\n\t\t\t\ttextX = this.width - text.width - margin;\n\t\t\t}\n\n\t\t\tlet textY = 0;\n\t\t\tconst padding = this._padding;\n\t\t\tconst ptop = padding.getTop();\n\t\t\tif (auto.height.isOn) {\n\t\t\t\ttextY = ptop;\n\t\t\t} else {\n\t\t\t\ttextY = ptop + (this.height - ptop - padding.getBottom() - text.height) * 0.5;\n\t\t\t}\n\n\t\t\ttext.position.set(textX, textY);\n\t\t}\n\t}\n\n\tprotected updateTextColor(text: DDynamicText): void {\n\t\tsuper.updateTextColor(text);\n\n\t\tconst shortcutText = this._shortcutText;\n\t\tif (shortcutText != null) {\n\t\t\tconst theme = this.theme;\n\t\t\tconst state = this.state;\n\t\t\tshortcutText.style.fill = theme.getShortcutColor(state);\n\t\t\tshortcutText.alpha = theme.getShortcutAlpha(state);\n\t\t}\n\t}\n\n\tprotected updateText(): void {\n\t\tsuper.updateText();\n\t\tthis.updateShortcutText();\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DMenuItemText\";\n\t}\n\n\tprotected onSelect(e: KeyboardEvent | interaction.InteractionEvent): void {\n\t\tsuper.onSelect(e);\n\t\tconst closeable = this.getCloseable();\n\t\tif (closeable != null) {\n\t\t\tcloseable.emit(\"select\", this.value, this, closeable);\n\t\t}\n\t}\n\n\tprotected onShortcut(e: KeyboardEvent): void {\n\t\tsuper.onShortcut(e);\n\t\tthis.onSelect(e);\n\t}\n}\n"]}
|
|
@@ -30,12 +30,12 @@ var DMenuSided = /** @class */ (function (_super) {
|
|
|
30
30
|
DMenuSided.prototype.newSelection = function (options) {
|
|
31
31
|
return new DMenuSidedSelection(this.content, options);
|
|
32
32
|
};
|
|
33
|
-
DMenuSided.prototype.
|
|
33
|
+
DMenuSided.prototype.onHierarchyDirty = function () {
|
|
34
34
|
var selection = this._selection;
|
|
35
35
|
if (selection != null) {
|
|
36
36
|
selection.toDirty();
|
|
37
37
|
}
|
|
38
|
-
_super.prototype.
|
|
38
|
+
_super.prototype.onHierarchyDirty.call(this);
|
|
39
39
|
};
|
|
40
40
|
DMenuSided.prototype.newItems = function (items, sticky) {
|
|
41
41
|
DMenuSideds.newItems(this.content, items, sticky);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-menu-sided.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-menu-sided.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EAAa,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAA4B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAA8B,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAA4B,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAc/D;IASU,8BAAsC;IAI/C,oBAAY,OAAiB;;QAA7B,YACC,kBAAM,OAAO,CAAC,SAed;QAbA,IAAM,OAAO,GAAG,IAAI,YAAY,CAAC,KAAI,CAAC,CAAC;QACvC,KAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,KAAI,CAAC,CAAC;QAElB,IAAM,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAC;QAC7B,IAAI,KAAK,IAAI,IAAI,EAAE;YAClB,IAAM,MAAM,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,KAAK,CAAC;YACxC,KAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SAC7B;QAED,IAAM,SAAS,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAA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ACC,OAAO,YAAY,CAAC;IACrB,CAAC;IACF,iBAAC;AAAD,CAAC,AAlFD,CASU,KAAK,GAyEd","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DisplayObject } from \"pixi.js\";\nimport { DBase, DBaseOptions } from \"./d-base\";\nimport { Closeable, DMenuContext } from \"./d-menu-context\";\nimport { DMenuItemOptionsUnion } from \"./d-menu-item-options-union\";\nimport { DMenuSidedContent, DMenuSidedContentOptions } from \"./d-menu-sided-content\";\nimport { DMenuSidedSelection, DMenuSidedSelectionOptions } from \"./d-menu-sided-selection\";\nimport { DMenuSideds } from \"./d-menu-sideds\";\nimport { DPane, DPaneOptions, DThemePane } from \"./d-pane\";\nimport { UtilKeyboardEvent } from \"./util/util-keyboard-event\";\n\nexport interface DMenuSidedOptions<\n\tVALUE = unknown,\n\tTHEME extends DThemeMenuSided = DThemeMenuSided,\n\tCONTENT_OPTIONS extends DBaseOptions = DMenuSidedContentOptions\n> extends DPaneOptions<THEME, CONTENT_OPTIONS> {\n\titems?: Array<DMenuItemOptionsUnion<VALUE> | DisplayObject>;\n\tsticky?: boolean;\n\tselection?: DMenuSidedSelectionOptions | DMenuSidedSelection<VALUE>;\n}\n\nexport interface DThemeMenuSided extends DThemePane {}\n\nexport class DMenuSided<\n\tVALUE = unknown,\n\tTHEME extends DThemeMenuSided = DThemeMenuSided,\n\tCONTENT_OPTIONS extends DMenuSidedContentOptions = DMenuSidedContentOptions,\n\tOPTIONS extends DMenuSidedOptions<VALUE, THEME, CONTENT_OPTIONS> = DMenuSidedOptions<\n\t\tVALUE,\n\t\tTHEME,\n\t\tCONTENT_OPTIONS\n\t>\n> extends DPane<THEME, CONTENT_OPTIONS, OPTIONS> {\n\tprotected _context: DMenuContext | null;\n\tprotected _selection: DMenuSidedSelection<VALUE>;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\tconst context = new DMenuContext(this);\n\t\tthis._context = context;\n\t\tcontext.add(this);\n\n\t\tconst items = options?.items;\n\t\tif (items != null) {\n\t\t\tconst sticky = options?.sticky ?? false;\n\t\t\tthis.newItems(items, sticky);\n\t\t}\n\n\t\tconst selection = options?.selection;\n\t\tthis._selection =\n\t\t\tselection instanceof DMenuSidedSelection ? selection : this.newSelection(selection);\n\t}\n\n\tprotected newSelection(options?: DMenuSidedSelectionOptions): DMenuSidedSelection<VALUE> {\n\t\treturn new DMenuSidedSelection<VALUE>(this.content, options);\n\t}\n\n\tprotected onHierarchyDirty(): void {\n\t\tconst selection = this._selection;\n\t\tif (selection != null) {\n\t\t\tselection.toDirty();\n\t\t}\n\t\tsuper.onHierarchyDirty();\n\t}\n\n\tprotected newItems(\n\t\titems: Array<DMenuItemOptionsUnion<VALUE> | DisplayObject>,\n\t\tsticky: boolean\n\t): void {\n\t\tDMenuSideds.newItems(this.content, items, sticky);\n\t}\n\n\tprotected newContent(options?: CONTENT_OPTIONS): DBase {\n\t\treturn new DMenuSidedContent(options);\n\t}\n\n\tget selection(): DMenuSidedSelection<VALUE> {\n\t\treturn this._selection;\n\t}\n\n\tgetContext(): DMenuContext | null {\n\t\treturn this._context;\n\t}\n\n\tgetCloseable(): Closeable | null {\n\t\treturn this;\n\t}\n\n\topen(): void {\n\t\t// DO NOTHING\n\t}\n\n\tclose(): void {\n\t\t// DO NOTHING\n\t}\n\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tUtilKeyboardEvent.moveFocusVertically(e, this);\n\t\treturn super.onKeyDown(e);\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DMenuSided\";\n\t}\n}\n"]}
|
|
@@ -65,8 +65,12 @@ var DPickerColorGradient = /** @class */ (function (_super) {
|
|
|
65
65
|
};
|
|
66
66
|
this._anchors = [];
|
|
67
67
|
//
|
|
68
|
+
var recentColumn = theme.getGradientRecentColumn();
|
|
69
|
+
var recentWidth = theme.getGradientRecentWidth();
|
|
70
|
+
var recentMargin = theme.getGradientRecentMargin();
|
|
71
|
+
var recentWidthAndMargin = recentWidth + recentMargin;
|
|
68
72
|
var inputLabelWidth = picker.theme.getInputLabelWidth();
|
|
69
|
-
var inputWidth =
|
|
73
|
+
var inputWidth = recentWidth * recentColumn + recentMargin * (recentColumn - 1);
|
|
70
74
|
var inputMargin = 5;
|
|
71
75
|
var inputDirectionMargin = theme.getGradientDirectionMargin();
|
|
72
76
|
var inputDirectionTexture = theme.getGradientDirectionTexture();
|
|
@@ -75,7 +79,7 @@ var DPickerColorGradient = /** @class */ (function (_super) {
|
|
|
75
79
|
parent: this,
|
|
76
80
|
x: inputLeft + inputLabelWidth + inputMargin,
|
|
77
81
|
y: paddingTop,
|
|
78
|
-
width: inputWidth - inputLabelWidth
|
|
82
|
+
width: inputWidth - (inputLabelWidth + inputMargin) * 2,
|
|
79
83
|
step: 1,
|
|
80
84
|
image: {
|
|
81
85
|
source: inputDirectionTexture,
|
|
@@ -93,10 +97,6 @@ var DPickerColorGradient = /** @class */ (function (_super) {
|
|
|
93
97
|
}
|
|
94
98
|
});
|
|
95
99
|
// Recent gradients
|
|
96
|
-
var recentColumn = theme.getGradientRecentColumn();
|
|
97
|
-
var recentWidth = theme.getGradientRecentWidth();
|
|
98
|
-
var recentMargin = theme.getGradientRecentMargin();
|
|
99
|
-
var recentWidthAndMargin = recentWidth + recentMargin;
|
|
100
100
|
var x0 = inputLeft;
|
|
101
101
|
var y0 = inputDirection.y + inputDirection.height + inputDirectionMargin;
|
|
102
102
|
if (DPickerColorGradient.RECENT_COLOR_GRADIENT == null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-picker-color-gradient.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-picker-color-gradient.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAe,KAAK,EAAE,MAAM,EAAW,MAAM,SAAS,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,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Q,IAAI,IAAI,EAAE;oBACrB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;oBACvB,iBAAM,SAAS,YAAC,CAAC,CAAC,CAAC;oBACnB,OAAO,IAAI,CAAC;iBACZ;aACD;SACD;QACD,OAAO,iBAAM,SAAS,YAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAES,sCAAO,GAAjB;QACC,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IA7UgB,0CAAqB,GAAsC,IAAI,CAAC;IA8UlF,2BAAC;CAAA,AAlVD,CAGU,KAAK,GA+Ud;SAlVY,oBAAoB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, Point, Sprite, Texture } from \"pixi.js\";\nimport InteractionEvent = interaction.InteractionEvent;\nimport { DAlignWith } from \"./d-align-with\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase, DBaseOptions, DThemeBase } from \"./d-base\";\nimport { DColorGradient, DColorGradientPoint } from \"./d-color-gradient\";\nimport { DColorGradientObservable } from \"./d-color-gradient-observable\";\nimport { DInputReal } from \"./d-input-real\";\nimport { DPickerColor } from \"./d-picker-color\";\nimport { DPickerColorGradientRecent } from \"./d-picker-color-gradient-recent\";\nimport { DPickerColorGradientView } from \"./d-picker-color-gradient-view\";\nimport { UtilKeyboardEvent } from \"./util/util-keyboard-event\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\n\nexport interface DPickerColorGradientOptions<\n\tTHEME extends DThemePickerColorGradient = DThemePickerColorGradient\n> extends DBaseOptions<THEME> {}\n\nexport interface DThemePickerColorGradient extends DThemeBase {\n\tgetGradientPointsWidth(): number;\n\tgetGradientPointsMargin(): number;\n\n\tgetGradientAnchorTexture(): Texture;\n\tgetGradientAnchorOutlinedTexture(): Texture;\n\tgetGradientAnchorOutlineTexture(): Texture;\n\n\tgetGradientDirectionMargin(): number;\n\tgetGradientDirectionTexture(): Texture;\n\n\tgetGradientRecentColumn(): number;\n\tgetGradientRecentWidth(): number;\n\tgetGradientRecentMargin(): number;\n\tgetGradientRecentCount(): number;\n\tgetGradientRecents(): DColorGradient[];\n\n\tgetGradientCheckerColors(): [number, number];\n}\n\nexport class DPickerColorGradient<\n\tTHEME extends DThemePickerColorGradient = DThemePickerColorGradient,\n\tOPTIONS extends DPickerColorGradientOptions<THEME> = DPickerColorGradientOptions<THEME>\n> extends DBase<THEME, OPTIONS> {\n\tprotected static RECENT_COLOR_GRADIENT: DPickerColorGradientRecent | null = null;\n\n\tprotected _picker!: DPickerColor;\n\tprotected _view!: DPickerColorGradientView;\n\tprotected _anchors!: Sprite[];\n\tprotected _recent!: DPickerColorGradientRecent;\n\n\tprotected _onAnchorDownBound!: (e: InteractionEvent) => void;\n\tprotected _onAnchorMoveBound!: (e: InteractionEvent) => void;\n\tprotected _onAnchorUpBound!: (e: InteractionEvent) => void;\n\n\tprotected _value!: DColorGradientObservable;\n\tprotected _work!: Point;\n\n\tprotected init(options?: OPTIONS): void {\n\t\tsuper.init(options);\n\n\t\tconst theme = this.theme;\n\t\tconst padding = this._padding;\n\t\tconst paddingTop = padding.getTop();\n\t\tconst paddingRight = padding.getRight();\n\t\tconst paddingBottom = padding.getBottom();\n\t\tconst paddingLeft = padding.getLeft();\n\t\tthis._work = new Point();\n\n\t\t// Picker\n\t\tconst gradientPointsWidth = theme.getGradientPointsWidth();\n\t\tconst gradientPointsMargin = theme.getGradientPointsMargin();\n\t\tconst picker = new DPickerColor({\n\t\t\tx: paddingLeft + gradientPointsWidth + gradientPointsMargin,\n\t\t\ty: paddingTop\n\t\t});\n\t\tthis._picker = picker;\n\t\tpicker.on(\"newcolorchange\", (color: number): void => {\n\t\t\tthis.onAnchorColorChange(color);\n\t\t});\n\t\tpicker.on(\"newalphachange\", (alpha: number): void => {\n\t\t\tthis.onAnchorAlphaChange(alpha);\n\t\t});\n\t\tthis.addChild(picker);\n\n\t\t// Points view\n\t\tconst view = (this._view = DPickerColorGradientView.from(\n\t\t\t17,\n\t\t\t10,\n\t\t\ttheme.getGradientCheckerColors()\n\t\t));\n\t\tview.setRectangle(0, paddingLeft, paddingTop, gradientPointsWidth, picker.height);\n\t\tthis.addChild(view);\n\t\tview.on(UtilPointerEvent.down, (e: InteractionEvent): void => {\n\t\t\tif (view.getLastHitIndex() === 0) {\n\t\t\t\tthis.onViewDown(e);\n\t\t\t}\n\t\t});\n\n\t\t// Anchor\n\t\tthis._onAnchorDownBound = (e: InteractionEvent): void => {\n\t\t\tthis.onAnchorDown(e);\n\t\t};\n\t\tthis._onAnchorMoveBound = (e: InteractionEvent): void => {\n\t\t\tthis.onAnchorMove(e);\n\t\t};\n\t\tthis._onAnchorUpBound = (e: InteractionEvent): void => {\n\t\t\tthis.onAnchorUp(e);\n\t\t};\n\t\tthis._anchors = [];\n\n\t\t//\n\t\tconst inputLabelWidth = picker.theme.getInputLabelWidth();\n\t\tconst inputWidth = picker.theme.getMainWidth() * 0.5;\n\t\tconst inputMargin = 5;\n\t\tconst inputDirectionMargin = theme.getGradientDirectionMargin();\n\t\tconst inputDirectionTexture = theme.getGradientDirectionTexture();\n\t\tconst inputLeft = picker.x + picker.width + inputDirectionMargin;\n\t\tconst inputDirection = new DInputReal({\n\t\t\tparent: this,\n\t\t\tx: inputLeft + inputLabelWidth + inputMargin,\n\t\t\ty: paddingTop,\n\t\t\twidth: inputWidth - inputLabelWidth - inputMargin,\n\t\t\tstep: 1,\n\t\t\timage: {\n\t\t\t\tsource: inputDirectionTexture,\n\t\t\t\talign: {\n\t\t\t\t\twith: DAlignWith.BORDER\n\t\t\t\t},\n\t\t\t\tmargin: {\n\t\t\t\t\thorizontal: -inputDirectionTexture.width - inputMargin\n\t\t\t\t}\n\t\t\t},\n\t\t\ton: {\n\t\t\t\tchange: (value: number) => {\n\t\t\t\t\t(this._value as any)._direction = value;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Recent gradients\n\t\tconst recentColumn = theme.getGradientRecentColumn();\n\t\tconst recentWidth = theme.getGradientRecentWidth();\n\t\tconst recentMargin = theme.getGradientRecentMargin();\n\t\tconst recentWidthAndMargin = recentWidth + recentMargin;\n\t\tconst x0 = inputLeft;\n\t\tconst y0 = inputDirection.y + inputDirection.height + inputDirectionMargin;\n\t\tif (DPickerColorGradient.RECENT_COLOR_GRADIENT == null) {\n\t\t\tDPickerColorGradient.RECENT_COLOR_GRADIENT = new DPickerColorGradientRecent(\n\t\t\t\ttheme.getGradientRecents(),\n\t\t\t\ttheme.getGradientRecentCount()\n\t\t\t);\n\t\t}\n\t\tthis._recent = DPickerColorGradient.RECENT_COLOR_GRADIENT;\n\t\tconst recent = this._recent;\n\t\tfor (let i = 0, imax = recent.getCapacity(); i < imax; ++i) {\n\t\t\tconst ix = i % recentColumn;\n\t\t\tconst x = x0 + ix * recentWidthAndMargin;\n\t\t\tconst iy = (i / recentColumn) | 0;\n\t\t\tconst y = y0 + iy * recentWidthAndMargin;\n\t\t\tview.setRectangle(1 + i, x, y, recentWidth, recentWidth);\n\t\t}\n\t\trecent.on(\"change\", (): void => {\n\t\t\tthis.onRecentUpdate();\n\t\t});\n\t\tUtilPointerEvent.onClick(view, (e: InteractionEvent): void => {\n\t\t\tconst lastHitIndex = view.getLastHitIndex();\n\t\t\tif (1 <= lastHitIndex) {\n\t\t\t\tthis.onRecentClick(view.getData(lastHitIndex));\n\t\t\t}\n\t\t});\n\n\t\t// Points\n\t\tconst data = new DColorGradientObservable();\n\t\tthis._value = data;\n\t\tdata.on(\"change\", (): void => {\n\t\t\tthis.updateAnchors();\n\t\t\tview.update();\n\t\t});\n\t\tdata.on(\"selectionchange\", (point: DColorGradientPoint): void => {\n\t\t\tthis.onAnchorSelect(point);\n\t\t});\n\t\tdata.on(\"directionchange\", (value: number): void => {\n\t\t\tinputDirection.value = value;\n\t\t});\n\t\tview.setData(0, data);\n\t\tview.update();\n\t\tinputDirection.value = data.direction;\n\t\tthis.updateAnchors();\n\t\tconst selected = data.selected;\n\t\tif (selected != null) {\n\t\t\tthis.onAnchorSelect(selected);\n\t\t}\n\n\t\t// Width\n\t\tif (options == null || options.width == null) {\n\t\t\tthis.width =\n\t\t\t\tpaddingLeft +\n\t\t\t\tgradientPointsWidth +\n\t\t\t\tgradientPointsMargin +\n\t\t\t\tpicker.width +\n\t\t\t\tinputDirectionMargin +\n\t\t\t\t(recentColumn - 1) * recentMargin +\n\t\t\t\trecentColumn * recentWidth +\n\t\t\t\tpaddingRight;\n\t\t}\n\n\t\t// Height\n\t\tif (options == null || options.height == null) {\n\t\t\tthis.height = paddingTop + picker.height + paddingBottom;\n\t\t}\n\t}\n\n\tget value(): DColorGradientObservable {\n\t\treturn this._value;\n\t}\n\n\tget recent(): DPickerColorGradientRecent {\n\t\treturn this._recent;\n\t}\n\n\tprotected onRecentClick(recentData: DColorGradient | null): void {\n\t\tconst value = this._value;\n\t\tif (recentData != null) {\n\t\t\tvalue.fromObject(recentData);\n\t\t} else {\n\t\t\tvalue.reset();\n\t\t}\n\t}\n\n\tprotected onRecentUpdate(): void {\n\t\tconst recent = this._recent;\n\t\tconst view = this._view;\n\t\tfor (let i = 0, imax = recent.size(); i < imax; ++i) {\n\t\t\tview.setData(1 + i, recent.get(i));\n\t\t}\n\t\tview.update();\n\t\tDApplications.update(this);\n\t}\n\n\tprotected toAnchorPosition(e: InteractionEvent): number {\n\t\tconst local = this.toLocal(e.data.global, undefined, this._work);\n\t\treturn Math.max(0, Math.min(1, (local.y - this.padding.getTop()) / this._picker.height));\n\t}\n\n\tprotected onViewDown(e: InteractionEvent): void {\n\t\tthis._value.addAt(this.toAnchorPosition(e));\n\t\tthis.onAnchorDragStart();\n\t}\n\n\tprotected onAnchorDown(e: InteractionEvent): void {\n\t\tconst target = e.target;\n\t\tif (target instanceof Sprite) {\n\t\t\tconst value = this._value;\n\t\t\tconst index = this._anchors.indexOf(target);\n\t\t\tif (0 <= index && index < value.points.length) {\n\t\t\t\tvalue.points[index].selected = true;\n\t\t\t\tthis.onAnchorDragStart();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onAnchorSelect(point: DColorGradientPoint): void {\n\t\tconst picker = this._picker;\n\t\tpicker.current.color = point.color;\n\t\tpicker.current.alpha = point.alpha;\n\t\tpicker.new.color = point.color;\n\t\tpicker.new.alpha = point.alpha;\n\t}\n\n\tprotected onAnchorColorChange(color: number): void {\n\t\tconst value = this._value;\n\t\tif (value != null) {\n\t\t\tconst selected = value.selected;\n\t\t\tif (selected != null) {\n\t\t\t\tselected.color = color;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onAnchorAlphaChange(alpha: number): void {\n\t\tconst value = this._value;\n\t\tif (value != null) {\n\t\t\tconst selected = value.selected;\n\t\t\tif (selected != null) {\n\t\t\t\tselected.alpha = alpha;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onAnchorDragStart(): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tconst stage = layer.stage;\n\t\t\tstage.on(UtilPointerEvent.move, this._onAnchorMoveBound);\n\t\t\tstage.on(UtilPointerEvent.up, this._onAnchorUpBound);\n\t\t}\n\t}\n\n\tprotected onAnchorMove(e: InteractionEvent): void {\n\t\tconst value = this._value;\n\t\tif (value != null) {\n\t\t\tconst selected = value.selected;\n\t\t\tif (selected != null) {\n\t\t\t\tselected.position = this.toAnchorPosition(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onAnchorUp(e: InteractionEvent): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tconst stage = layer.stage;\n\t\t\tstage.off(UtilPointerEvent.move, this._onAnchorMoveBound);\n\t\t\tstage.off(UtilPointerEvent.up, this._onAnchorUpBound);\n\t\t}\n\t}\n\n\tprotected updateAnchors(): void {\n\t\tconst theme = this.theme;\n\t\tconst anchorTexture = theme.getGradientAnchorTexture();\n\t\tconst anchorOutlinedTexture = theme.getGradientAnchorOutlinedTexture();\n\t\tconst gradientPointsWidth = theme.getGradientPointsWidth();\n\n\t\tconst value = this._value;\n\t\tconst pointSize = value.points.length;\n\n\t\tconst anchors = this._anchors;\n\t\tconst anchorSize = anchors.length;\n\t\tfor (let i = anchorSize; i < pointSize; ++i) {\n\t\t\tconst newAnchor = new Sprite(anchorTexture);\n\t\t\tnewAnchor.anchor.set(0.5, 0.5);\n\t\t\tnewAnchor.cursor = \"pointer\";\n\t\t\tnewAnchor.interactive = true;\n\t\t\tnewAnchor.on(UtilPointerEvent.down, this._onAnchorDownBound);\n\t\t\tanchors.push(newAnchor);\n\t\t\tthis.addChild(newAnchor);\n\t\t}\n\n\t\tfor (let i = anchorSize - 1; pointSize <= i; --i) {\n\t\t\tconst oldAnchor = anchors[i];\n\t\t\toldAnchor.off(UtilPointerEvent.down, this._onAnchorDownBound);\n\t\t\toldAnchor.destroy();\n\t\t}\n\t\tanchors.length = pointSize;\n\n\t\tconst y = this.padding.getTop();\n\t\tconst right = this.padding.getLeft() + gradientPointsWidth;\n\t\tconst height = this._picker.height;\n\t\tfor (let i = 0; i < pointSize; ++i) {\n\t\t\tconst point = value.points[i];\n\t\t\tconst anchor = anchors[i];\n\t\t\tanchor.tint = point.color;\n\t\t\tanchor.position.set(right, y + height * point.position);\n\t\t\tanchor.texture = point.selected ? anchorOutlinedTexture : anchorTexture;\n\t\t}\n\n\t\tDApplications.update(this);\n\t}\n\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tif (UtilKeyboardEvent.isDeleteKey(e)) {\n\t\t\tconst value = this._value;\n\t\t\tif (value != null) {\n\t\t\t\tconst selected = value.selected;\n\t\t\t\tif (selected != null) {\n\t\t\t\t\tvalue.remove(selected);\n\t\t\t\t\tsuper.onKeyDown(e);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn super.onKeyDown(e);\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DPickerColorGradient\";\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-picker-color-gradient.js","sourceRoot":"","sources":["../../../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AED,wCAAS,GAAT,UAAU,CAAgB;QACzB,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;YACrC,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,IAAI,KAAK,IAAI,IAAI,EAAE;gBAClB,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;gBAChC,IAAI,QAAQ,IAAI,IAAI,EAAE;oBACrB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;oBACvB,iBAAM,SAAS,YAAC,CAAC,CAAC,CAAC;oBACnB,OAAO,IAAI,CAAC;iBACZ;aACD;SACD;QACD,OAAO,iBAAM,SAAS,YAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAES,sCAAO,GAAjB;QACC,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IA7UgB,0CAAqB,GAAsC,IAAI,CAAC;IA8UlF,2BAAC;CAAA,AAlVD,CAGU,KAAK,GA+Ud;SAlVY,oBAAoB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, Point, Sprite, Texture } from \"pixi.js\";\nimport InteractionEvent = interaction.InteractionEvent;\nimport { DAlignWith } from \"./d-align-with\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase, DBaseOptions, DThemeBase } from \"./d-base\";\nimport { DColorGradient, DColorGradientPoint } from \"./d-color-gradient\";\nimport { DColorGradientObservable } from \"./d-color-gradient-observable\";\nimport { DInputReal } from \"./d-input-real\";\nimport { DPickerColor } from \"./d-picker-color\";\nimport { DPickerColorGradientRecent } from \"./d-picker-color-gradient-recent\";\nimport { DPickerColorGradientView } from \"./d-picker-color-gradient-view\";\nimport { UtilKeyboardEvent } from \"./util/util-keyboard-event\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\n\nexport interface DPickerColorGradientOptions<\n\tTHEME extends DThemePickerColorGradient = DThemePickerColorGradient\n> extends DBaseOptions<THEME> {}\n\nexport interface DThemePickerColorGradient extends DThemeBase {\n\tgetGradientPointsWidth(): number;\n\tgetGradientPointsMargin(): number;\n\n\tgetGradientAnchorTexture(): Texture;\n\tgetGradientAnchorOutlinedTexture(): Texture;\n\tgetGradientAnchorOutlineTexture(): Texture;\n\n\tgetGradientDirectionMargin(): number;\n\tgetGradientDirectionTexture(): Texture;\n\n\tgetGradientRecentColumn(): number;\n\tgetGradientRecentWidth(): number;\n\tgetGradientRecentMargin(): number;\n\tgetGradientRecentCount(): number;\n\tgetGradientRecents(): DColorGradient[];\n\n\tgetGradientCheckerColors(): [number, number];\n}\n\nexport class DPickerColorGradient<\n\tTHEME extends DThemePickerColorGradient = DThemePickerColorGradient,\n\tOPTIONS extends DPickerColorGradientOptions<THEME> = DPickerColorGradientOptions<THEME>\n> extends DBase<THEME, OPTIONS> {\n\tprotected static RECENT_COLOR_GRADIENT: DPickerColorGradientRecent | null = null;\n\n\tprotected _picker!: DPickerColor;\n\tprotected _view!: DPickerColorGradientView;\n\tprotected _anchors!: Sprite[];\n\tprotected _recent!: DPickerColorGradientRecent;\n\n\tprotected _onAnchorDownBound!: (e: InteractionEvent) => void;\n\tprotected _onAnchorMoveBound!: (e: InteractionEvent) => void;\n\tprotected _onAnchorUpBound!: (e: InteractionEvent) => void;\n\n\tprotected _value!: DColorGradientObservable;\n\tprotected _work!: Point;\n\n\tprotected init(options?: OPTIONS): void {\n\t\tsuper.init(options);\n\n\t\tconst theme = this.theme;\n\t\tconst padding = this._padding;\n\t\tconst paddingTop = padding.getTop();\n\t\tconst paddingRight = padding.getRight();\n\t\tconst paddingBottom = padding.getBottom();\n\t\tconst paddingLeft = padding.getLeft();\n\t\tthis._work = new Point();\n\n\t\t// Picker\n\t\tconst gradientPointsWidth = theme.getGradientPointsWidth();\n\t\tconst gradientPointsMargin = theme.getGradientPointsMargin();\n\t\tconst picker = new DPickerColor({\n\t\t\tx: paddingLeft + gradientPointsWidth + gradientPointsMargin,\n\t\t\ty: paddingTop\n\t\t});\n\t\tthis._picker = picker;\n\t\tpicker.on(\"newcolorchange\", (color: number): void => {\n\t\t\tthis.onAnchorColorChange(color);\n\t\t});\n\t\tpicker.on(\"newalphachange\", (alpha: number): void => {\n\t\t\tthis.onAnchorAlphaChange(alpha);\n\t\t});\n\t\tthis.addChild(picker);\n\n\t\t// Points view\n\t\tconst view = (this._view = DPickerColorGradientView.from(\n\t\t\t17,\n\t\t\t10,\n\t\t\ttheme.getGradientCheckerColors()\n\t\t));\n\t\tview.setRectangle(0, paddingLeft, paddingTop, gradientPointsWidth, picker.height);\n\t\tthis.addChild(view);\n\t\tview.on(UtilPointerEvent.down, (e: InteractionEvent): void => {\n\t\t\tif (view.getLastHitIndex() === 0) {\n\t\t\t\tthis.onViewDown(e);\n\t\t\t}\n\t\t});\n\n\t\t// Anchor\n\t\tthis._onAnchorDownBound = (e: InteractionEvent): void => {\n\t\t\tthis.onAnchorDown(e);\n\t\t};\n\t\tthis._onAnchorMoveBound = (e: InteractionEvent): void => {\n\t\t\tthis.onAnchorMove(e);\n\t\t};\n\t\tthis._onAnchorUpBound = (e: InteractionEvent): void => {\n\t\t\tthis.onAnchorUp(e);\n\t\t};\n\t\tthis._anchors = [];\n\n\t\t//\n\t\tconst recentColumn = theme.getGradientRecentColumn();\n\t\tconst recentWidth = theme.getGradientRecentWidth();\n\t\tconst recentMargin = theme.getGradientRecentMargin();\n\t\tconst recentWidthAndMargin = recentWidth + recentMargin;\n\t\tconst inputLabelWidth = picker.theme.getInputLabelWidth();\n\t\tconst inputWidth = recentWidth * recentColumn + recentMargin * (recentColumn - 1);\n\t\tconst inputMargin = 5;\n\t\tconst inputDirectionMargin = theme.getGradientDirectionMargin();\n\t\tconst inputDirectionTexture = theme.getGradientDirectionTexture();\n\t\tconst inputLeft = picker.x + picker.width + inputDirectionMargin;\n\t\tconst inputDirection = new DInputReal({\n\t\t\tparent: this,\n\t\t\tx: inputLeft + inputLabelWidth + inputMargin,\n\t\t\ty: paddingTop,\n\t\t\twidth: inputWidth - (inputLabelWidth + inputMargin) * 2,\n\t\t\tstep: 1,\n\t\t\timage: {\n\t\t\t\tsource: inputDirectionTexture,\n\t\t\t\talign: {\n\t\t\t\t\twith: DAlignWith.BORDER\n\t\t\t\t},\n\t\t\t\tmargin: {\n\t\t\t\t\thorizontal: -inputDirectionTexture.width - inputMargin\n\t\t\t\t}\n\t\t\t},\n\t\t\ton: {\n\t\t\t\tchange: (value: number) => {\n\t\t\t\t\t(this._value as any)._direction = value;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Recent gradients\n\t\tconst x0 = inputLeft;\n\t\tconst y0 = inputDirection.y + inputDirection.height + inputDirectionMargin;\n\t\tif (DPickerColorGradient.RECENT_COLOR_GRADIENT == null) {\n\t\t\tDPickerColorGradient.RECENT_COLOR_GRADIENT = new DPickerColorGradientRecent(\n\t\t\t\ttheme.getGradientRecents(),\n\t\t\t\ttheme.getGradientRecentCount()\n\t\t\t);\n\t\t}\n\t\tthis._recent = DPickerColorGradient.RECENT_COLOR_GRADIENT;\n\t\tconst recent = this._recent;\n\t\tfor (let i = 0, imax = recent.getCapacity(); i < imax; ++i) {\n\t\t\tconst ix = i % recentColumn;\n\t\t\tconst x = x0 + ix * recentWidthAndMargin;\n\t\t\tconst iy = (i / recentColumn) | 0;\n\t\t\tconst y = y0 + iy * recentWidthAndMargin;\n\t\t\tview.setRectangle(1 + i, x, y, recentWidth, recentWidth);\n\t\t}\n\t\trecent.on(\"change\", (): void => {\n\t\t\tthis.onRecentUpdate();\n\t\t});\n\t\tUtilPointerEvent.onClick(view, (e: InteractionEvent): void => {\n\t\t\tconst lastHitIndex = view.getLastHitIndex();\n\t\t\tif (1 <= lastHitIndex) {\n\t\t\t\tthis.onRecentClick(view.getData(lastHitIndex));\n\t\t\t}\n\t\t});\n\n\t\t// Points\n\t\tconst data = new DColorGradientObservable();\n\t\tthis._value = data;\n\t\tdata.on(\"change\", (): void => {\n\t\t\tthis.updateAnchors();\n\t\t\tview.update();\n\t\t});\n\t\tdata.on(\"selectionchange\", (point: DColorGradientPoint): void => {\n\t\t\tthis.onAnchorSelect(point);\n\t\t});\n\t\tdata.on(\"directionchange\", (value: number): void => {\n\t\t\tinputDirection.value = value;\n\t\t});\n\t\tview.setData(0, data);\n\t\tview.update();\n\t\tinputDirection.value = data.direction;\n\t\tthis.updateAnchors();\n\t\tconst selected = data.selected;\n\t\tif (selected != null) {\n\t\t\tthis.onAnchorSelect(selected);\n\t\t}\n\n\t\t// Width\n\t\tif (options == null || options.width == null) {\n\t\t\tthis.width =\n\t\t\t\tpaddingLeft +\n\t\t\t\tgradientPointsWidth +\n\t\t\t\tgradientPointsMargin +\n\t\t\t\tpicker.width +\n\t\t\t\tinputDirectionMargin +\n\t\t\t\t(recentColumn - 1) * recentMargin +\n\t\t\t\trecentColumn * recentWidth +\n\t\t\t\tpaddingRight;\n\t\t}\n\n\t\t// Height\n\t\tif (options == null || options.height == null) {\n\t\t\tthis.height = paddingTop + picker.height + paddingBottom;\n\t\t}\n\t}\n\n\tget value(): DColorGradientObservable {\n\t\treturn this._value;\n\t}\n\n\tget recent(): DPickerColorGradientRecent {\n\t\treturn this._recent;\n\t}\n\n\tprotected onRecentClick(recentData: DColorGradient | null): void {\n\t\tconst value = this._value;\n\t\tif (recentData != null) {\n\t\t\tvalue.fromObject(recentData);\n\t\t} else {\n\t\t\tvalue.reset();\n\t\t}\n\t}\n\n\tprotected onRecentUpdate(): void {\n\t\tconst recent = this._recent;\n\t\tconst view = this._view;\n\t\tfor (let i = 0, imax = recent.size(); i < imax; ++i) {\n\t\t\tview.setData(1 + i, recent.get(i));\n\t\t}\n\t\tview.update();\n\t\tDApplications.update(this);\n\t}\n\n\tprotected toAnchorPosition(e: InteractionEvent): number {\n\t\tconst local = this.toLocal(e.data.global, undefined, this._work);\n\t\treturn Math.max(0, Math.min(1, (local.y - this.padding.getTop()) / this._picker.height));\n\t}\n\n\tprotected onViewDown(e: InteractionEvent): void {\n\t\tthis._value.addAt(this.toAnchorPosition(e));\n\t\tthis.onAnchorDragStart();\n\t}\n\n\tprotected onAnchorDown(e: InteractionEvent): void {\n\t\tconst target = e.target;\n\t\tif (target instanceof Sprite) {\n\t\t\tconst value = this._value;\n\t\t\tconst index = this._anchors.indexOf(target);\n\t\t\tif (0 <= index && index < value.points.length) {\n\t\t\t\tvalue.points[index].selected = true;\n\t\t\t\tthis.onAnchorDragStart();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onAnchorSelect(point: DColorGradientPoint): void {\n\t\tconst picker = this._picker;\n\t\tpicker.current.color = point.color;\n\t\tpicker.current.alpha = point.alpha;\n\t\tpicker.new.color = point.color;\n\t\tpicker.new.alpha = point.alpha;\n\t}\n\n\tprotected onAnchorColorChange(color: number): void {\n\t\tconst value = this._value;\n\t\tif (value != null) {\n\t\t\tconst selected = value.selected;\n\t\t\tif (selected != null) {\n\t\t\t\tselected.color = color;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onAnchorAlphaChange(alpha: number): void {\n\t\tconst value = this._value;\n\t\tif (value != null) {\n\t\t\tconst selected = value.selected;\n\t\t\tif (selected != null) {\n\t\t\t\tselected.alpha = alpha;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onAnchorDragStart(): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tconst stage = layer.stage;\n\t\t\tstage.on(UtilPointerEvent.move, this._onAnchorMoveBound);\n\t\t\tstage.on(UtilPointerEvent.up, this._onAnchorUpBound);\n\t\t}\n\t}\n\n\tprotected onAnchorMove(e: InteractionEvent): void {\n\t\tconst value = this._value;\n\t\tif (value != null) {\n\t\t\tconst selected = value.selected;\n\t\t\tif (selected != null) {\n\t\t\t\tselected.position = this.toAnchorPosition(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onAnchorUp(e: InteractionEvent): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tconst stage = layer.stage;\n\t\t\tstage.off(UtilPointerEvent.move, this._onAnchorMoveBound);\n\t\t\tstage.off(UtilPointerEvent.up, this._onAnchorUpBound);\n\t\t}\n\t}\n\n\tprotected updateAnchors(): void {\n\t\tconst theme = this.theme;\n\t\tconst anchorTexture = theme.getGradientAnchorTexture();\n\t\tconst anchorOutlinedTexture = theme.getGradientAnchorOutlinedTexture();\n\t\tconst gradientPointsWidth = theme.getGradientPointsWidth();\n\n\t\tconst value = this._value;\n\t\tconst pointSize = value.points.length;\n\n\t\tconst anchors = this._anchors;\n\t\tconst anchorSize = anchors.length;\n\t\tfor (let i = anchorSize; i < pointSize; ++i) {\n\t\t\tconst newAnchor = new Sprite(anchorTexture);\n\t\t\tnewAnchor.anchor.set(0.5, 0.5);\n\t\t\tnewAnchor.cursor = \"pointer\";\n\t\t\tnewAnchor.interactive = true;\n\t\t\tnewAnchor.on(UtilPointerEvent.down, this._onAnchorDownBound);\n\t\t\tanchors.push(newAnchor);\n\t\t\tthis.addChild(newAnchor);\n\t\t}\n\n\t\tfor (let i = anchorSize - 1; pointSize <= i; --i) {\n\t\t\tconst oldAnchor = anchors[i];\n\t\t\toldAnchor.off(UtilPointerEvent.down, this._onAnchorDownBound);\n\t\t\toldAnchor.destroy();\n\t\t}\n\t\tanchors.length = pointSize;\n\n\t\tconst y = this.padding.getTop();\n\t\tconst right = this.padding.getLeft() + gradientPointsWidth;\n\t\tconst height = this._picker.height;\n\t\tfor (let i = 0; i < pointSize; ++i) {\n\t\t\tconst point = value.points[i];\n\t\t\tconst anchor = anchors[i];\n\t\t\tanchor.tint = point.color;\n\t\t\tanchor.position.set(right, y + height * point.position);\n\t\t\tanchor.texture = point.selected ? anchorOutlinedTexture : anchorTexture;\n\t\t}\n\n\t\tDApplications.update(this);\n\t}\n\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tif (UtilKeyboardEvent.isDeleteKey(e)) {\n\t\t\tconst value = this._value;\n\t\t\tif (value != null) {\n\t\t\t\tconst selected = value.selected;\n\t\t\t\tif (selected != null) {\n\t\t\t\t\tvalue.remove(selected);\n\t\t\t\t\tsuper.onKeyDown(e);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn super.onKeyDown(e);\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DPickerColorGradient\";\n\t}\n}\n"]}
|
|
@@ -157,32 +157,42 @@ var DTextBase = /** @class */ (function (_super) {
|
|
|
157
157
|
DTextBase.prototype.updateTextPosition = function (text) {
|
|
158
158
|
var align = this._textAlign;
|
|
159
159
|
var padding = this._padding;
|
|
160
|
-
var
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
text.x = toRounded((this.width - text.width) * 0.5);
|
|
167
|
-
break;
|
|
168
|
-
case DAlignHorizontal.RIGHT:
|
|
169
|
-
text.x = toRounded(this.width - text.width - padding.getRight());
|
|
170
|
-
break;
|
|
160
|
+
var auto = this._auto;
|
|
161
|
+
var textX = 0;
|
|
162
|
+
var pleft = padding.getLeft();
|
|
163
|
+
var alignHorizontal = align.horizontal;
|
|
164
|
+
if (auto.width.isOn || alignHorizontal === DAlignHorizontal.LEFT) {
|
|
165
|
+
textX = pleft;
|
|
171
166
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
167
|
+
else {
|
|
168
|
+
var width = this.width;
|
|
169
|
+
var textWidth = text.width;
|
|
170
|
+
var pright = padding.getRight();
|
|
171
|
+
if (alignHorizontal === DAlignHorizontal.CENTER) {
|
|
172
|
+
textX = pleft + (width - pleft - pright - textWidth) * 0.5;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
textX = width - textWidth - pright;
|
|
176
|
+
}
|
|
182
177
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
178
|
+
var textY = 0;
|
|
179
|
+
var ptop = padding.getTop();
|
|
180
|
+
var alignVertical = align.vertical;
|
|
181
|
+
if (auto.height.isOn || alignVertical === DAlignVertical.TOP) {
|
|
182
|
+
textY = ptop;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
var height = this.height;
|
|
186
|
+
var textHeight = text.height;
|
|
187
|
+
var pbottom = padding.getBottom();
|
|
188
|
+
if (alignVertical === DAlignVertical.MIDDLE) {
|
|
189
|
+
textY = ptop + (height - ptop - pbottom - textHeight) * 0.5;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
textY = height - textHeight - pbottom;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
text.position.set(textX, textY);
|
|
186
196
|
};
|
|
187
197
|
DTextBase.prototype.getTextColor = function (theme, state) {
|
|
188
198
|
var color = this._textColor;
|