jsbox-cview 1.5.1 → 1.5.2
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.
|
@@ -19,7 +19,7 @@ export class DialogSheet extends Sheet<ContentView, UIView, UiTypes.ViewOptions>
|
|
|
19
19
|
_props: {
|
|
20
20
|
title: string;
|
|
21
21
|
cview: Base<any, any>;
|
|
22
|
-
doneHandler?: () =>
|
|
22
|
+
doneHandler?: () => any;
|
|
23
23
|
presentMode?: number;
|
|
24
24
|
bgcolor?: UIColor;
|
|
25
25
|
doneButtonHidden?: boolean;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Base } from "./base";
|
|
2
2
|
|
|
3
|
-
interface SymbolButtonProps
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
interface SymbolButtonProps {
|
|
4
|
+
symbol?: string;
|
|
5
|
+
image?: UIImage;
|
|
6
|
+
src?: string;
|
|
7
|
+
tintColor: UIColor;
|
|
8
|
+
contentMode: number;
|
|
9
|
+
insets: JBInsets;
|
|
10
|
+
menu?: UiTypes.ContextMenuOptions
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
/**
|
|
@@ -26,12 +28,13 @@ export class SymbolButton extends Base<UIButtonView, UiTypes.ButtonOptions> {
|
|
|
26
28
|
layout,
|
|
27
29
|
events = {}
|
|
28
30
|
}: {
|
|
29
|
-
props:
|
|
31
|
+
props: Partial<SymbolButtonProps>;
|
|
30
32
|
layout?: (make: MASConstraintMaker, view: UIButtonView) => void;
|
|
31
33
|
events?: UiTypes.BaseViewEvents<UIButtonView>;
|
|
32
34
|
}) {
|
|
33
35
|
super();
|
|
34
36
|
this._props = {
|
|
37
|
+
contentMode: 1,
|
|
35
38
|
insets: $insets(12.5, 12.5, 12.5, 12.5),
|
|
36
39
|
tintColor: $color("primaryText"),
|
|
37
40
|
...props
|
|
@@ -61,7 +64,7 @@ export class SymbolButton extends Base<UIButtonView, UiTypes.ButtonOptions> {
|
|
|
61
64
|
image: this._props.image,
|
|
62
65
|
src: this._props.src,
|
|
63
66
|
tintColor: this._props.tintColor,
|
|
64
|
-
contentMode:
|
|
67
|
+
contentMode: this._props.contentMode
|
|
65
68
|
},
|
|
66
69
|
layout: (make, view: UIImageView) => {
|
|
67
70
|
make.edges.insets(this._props.insets);
|
|
@@ -77,17 +80,18 @@ export class SymbolButton extends Base<UIButtonView, UiTypes.ButtonOptions> {
|
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
set tintColor(tintColor: UIColor) {
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
(this.view.get("image") as UIImageView).tintColor = tintColor;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
set image(image: UIImage) {
|
|
87
|
+
(this.view.get("image") as UIImageView).image = image;
|
|
82
88
|
}
|
|
83
89
|
|
|
84
|
-
set symbol(symbol) {
|
|
85
|
-
this.
|
|
86
|
-
const image = this.view.get("image") as UIImageView;
|
|
87
|
-
image.symbol = symbol;
|
|
90
|
+
set symbol(symbol: string) {
|
|
91
|
+
(this.view.get("image") as UIImageView).symbol = symbol;
|
|
88
92
|
}
|
|
89
93
|
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
set src(src: string) {
|
|
95
|
+
(this.view.get("image") as UIImageView).src = src;
|
|
92
96
|
}
|
|
93
97
|
}
|
|
@@ -15,7 +15,7 @@ const base_1 = require("./base");
|
|
|
15
15
|
class SymbolButton extends base_1.Base {
|
|
16
16
|
constructor({ props, layout, events = {} }) {
|
|
17
17
|
super();
|
|
18
|
-
this._props = Object.assign({ insets: $insets(12.5, 12.5, 12.5, 12.5), tintColor: $color("primaryText") }, props);
|
|
18
|
+
this._props = Object.assign({ contentMode: 1, insets: $insets(12.5, 12.5, 12.5, 12.5), tintColor: $color("primaryText") }, props);
|
|
19
19
|
this._layout = layout;
|
|
20
20
|
this._defineView = () => {
|
|
21
21
|
const props = this._props.menu
|
|
@@ -41,7 +41,7 @@ class SymbolButton extends base_1.Base {
|
|
|
41
41
|
image: this._props.image,
|
|
42
42
|
src: this._props.src,
|
|
43
43
|
tintColor: this._props.tintColor,
|
|
44
|
-
contentMode:
|
|
44
|
+
contentMode: this._props.contentMode
|
|
45
45
|
},
|
|
46
46
|
layout: (make, view) => {
|
|
47
47
|
make.edges.insets(this._props.insets);
|
|
@@ -56,16 +56,16 @@ class SymbolButton extends base_1.Base {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
set tintColor(tintColor) {
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
this.view.get("image").tintColor = tintColor;
|
|
60
|
+
}
|
|
61
|
+
set image(image) {
|
|
62
|
+
this.view.get("image").image = image;
|
|
61
63
|
}
|
|
62
64
|
set symbol(symbol) {
|
|
63
|
-
this.
|
|
64
|
-
const image = this.view.get("image");
|
|
65
|
-
image.symbol = symbol;
|
|
65
|
+
this.view.get("image").symbol = symbol;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
set src(src) {
|
|
68
|
+
this.view.get("image").src = src;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
exports.SymbolButton = SymbolButton;
|