jpf 4.1.44 → 4.1.46
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/controls/svg/Pattern/Pattern.d.ts +25 -0
- package/dist/controls/svg/Pattern/Pattern.js +56 -0
- package/dist/controls/svg/Pattern/Pattern.js.map +1 -0
- package/dist/controls/svg/index.d.ts +1 -0
- package/dist/controls/svg/index.js +1 -0
- package/dist/controls/svg/index.js.map +1 -1
- package/dist/framework/View.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { View } from "../../../framework/View";
|
|
2
|
+
import { ViewModelOptions } from "../../../framework/ViewModel";
|
|
3
|
+
import { CircleView } from "../Circle/Circle";
|
|
4
|
+
import { EllipseView } from "../Ellipse/Ellipse";
|
|
5
|
+
import { LineView } from "../Line/Line";
|
|
6
|
+
import { PolygonView } from "../Polygon/Polygon";
|
|
7
|
+
import { PolylineView } from "../Polyline/Polyline";
|
|
8
|
+
import { TextView } from "../Text/Text";
|
|
9
|
+
type PatternUnits = "userSpaceOnUser" | "objectboudingBox";
|
|
10
|
+
export interface PatternViewModelOptions extends ViewModelOptions {
|
|
11
|
+
width: number | string;
|
|
12
|
+
height: number | string;
|
|
13
|
+
patternUnits?: PatternUnits;
|
|
14
|
+
patternTransform?: string;
|
|
15
|
+
pattern: CircleView | EllipseView | LineView | PolygonView | PolylineView | TextView;
|
|
16
|
+
}
|
|
17
|
+
export declare class PatternView extends View<PatternViewModelOptions> {
|
|
18
|
+
constructor(viewModel: PatternViewModelOptions);
|
|
19
|
+
build(): void;
|
|
20
|
+
private setWidth;
|
|
21
|
+
private setHeight;
|
|
22
|
+
private setPatternUnits;
|
|
23
|
+
private setPatternTransform;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { View } from "../../../framework/View";
|
|
2
|
+
import { extendViewModel } from "../../../framework/ViewModel";
|
|
3
|
+
import { svgNamespace } from "../svg";
|
|
4
|
+
export class PatternView extends View {
|
|
5
|
+
constructor(viewModel) {
|
|
6
|
+
super({
|
|
7
|
+
tagName: "pattern",
|
|
8
|
+
namespace: svgNamespace,
|
|
9
|
+
viewModel: extendViewModel({
|
|
10
|
+
viewType: "Pattern"
|
|
11
|
+
}, viewModel),
|
|
12
|
+
children: [viewModel.pattern]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
build() {
|
|
16
|
+
super.build();
|
|
17
|
+
const viewModel = this.viewModel;
|
|
18
|
+
this.setWidth(viewModel.width);
|
|
19
|
+
this.setHeight(viewModel.height);
|
|
20
|
+
this.setPatternUnits(viewModel.patternUnits);
|
|
21
|
+
this.setPatternTransform(viewModel.patternTransform);
|
|
22
|
+
}
|
|
23
|
+
setWidth(width) {
|
|
24
|
+
if (width) {
|
|
25
|
+
this.element.setAttribute("width", width.toString());
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.element.removeAttribute("width");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
setHeight(height) {
|
|
32
|
+
if (height) {
|
|
33
|
+
this.element.setAttribute("height", height.toString());
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.element.removeAttribute("height");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
setPatternUnits(patternUnits) {
|
|
40
|
+
if (patternUnits) {
|
|
41
|
+
this.element.setAttribute("patternUnits", patternUnits);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.element.removeAttribute("patternUnits");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
setPatternTransform(patternTransform) {
|
|
48
|
+
if (patternTransform) {
|
|
49
|
+
this.element.setAttribute("patternTransform", patternTransform);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.element.removeAttribute("patternTransform");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=Pattern.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AQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC1D;aAAM;YACH,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;SAC1C;IACL,CAAC;IAEO,eAAe,CAAC,YAA0B;QAC9C,IAAI,YAAY,EAAE;YACd,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;SAC3D;aAAM;YACH,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;SAChD;IACL,CAAC;IAEO,mBAAmB,CAAC,gBAAwB;QAChD,IAAI,gBAAgB,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;SACnE;aAAM;YACH,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;SACpD;IACL,CAAC;CACJ"}
|
|
@@ -2,6 +2,7 @@ export * from "./Circle/Circle";
|
|
|
2
2
|
export * from "./Ellipse/Ellipse";
|
|
3
3
|
export * from "./Group/Group";
|
|
4
4
|
export * from "./Line/Line";
|
|
5
|
+
export * from "./Pattern/Pattern";
|
|
5
6
|
export * from "./Polygon/Polygon";
|
|
6
7
|
export * from "./Polyline/Polyline";
|
|
7
8
|
export * from "./Rectangle/Rectangle";
|
|
@@ -2,6 +2,7 @@ export * from "./Circle/Circle";
|
|
|
2
2
|
export * from "./Ellipse/Ellipse";
|
|
3
3
|
export * from "./Group/Group";
|
|
4
4
|
export * from "./Line/Line";
|
|
5
|
+
export * from "./Pattern/Pattern";
|
|
5
6
|
export * from "./Polygon/Polygon";
|
|
6
7
|
export * from "./Polyline/Polyline";
|
|
7
8
|
export * from "./Rectangle/Rectangle";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/svg/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/svg/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
package/dist/framework/View.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import "tocca";
|
|
|
2
2
|
import { ObservableArray, Computed } from "knockout";
|
|
3
3
|
import { ViewModel } from "./ViewModel";
|
|
4
4
|
type HtmlTagName = "div" | "input" | "a" | "button" | "img" | "select" | "pre" | "form" | "span" | "textarea";
|
|
5
|
-
type SvgTagName = "svg" | "circle" | "ellipse" | "g" | "line" | "polygon" | "polyline" | "rect" | "text";
|
|
5
|
+
type SvgTagName = "svg" | "circle" | "ellipse" | "g" | "line" | "polygon" | "polyline" | "rect" | "text" | "pattern";
|
|
6
6
|
type TagName = HtmlTagName | SvgTagName;
|
|
7
7
|
export interface IView {
|
|
8
8
|
render(): HTMLElement;
|