@omnia/velcron 7.0.519-dev → 7.0.521-dev
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.
|
@@ -163,6 +163,8 @@ export interface VelcronTextDefinition extends VelcronDefinition {
|
|
|
163
163
|
type: "Text";
|
|
164
164
|
text: string;
|
|
165
165
|
color?: string;
|
|
166
|
+
lineClamp: number;
|
|
167
|
+
noWrap: boolean;
|
|
166
168
|
typography?: string;
|
|
167
169
|
events?: VelcronOnPressEvent;
|
|
168
170
|
}
|
|
@@ -174,6 +176,7 @@ export interface VelcronImageDefinition extends VelcronDefinition {
|
|
|
174
176
|
type: "Image";
|
|
175
177
|
source: string;
|
|
176
178
|
ratio: VelcronImageRatios;
|
|
179
|
+
borderRadius?: VelcronDimensions;
|
|
177
180
|
events?: VelcronOnPressEvent;
|
|
178
181
|
}
|
|
179
182
|
export interface VelcronButtonDefinition extends VelcronDefinition {
|
|
@@ -222,6 +225,7 @@ export interface VelcronFlexViewDefinition extends VelcronDefinition, VelcronCus
|
|
|
222
225
|
grow?: number;
|
|
223
226
|
border?: VelcronBorder;
|
|
224
227
|
borderRadius?: VelcronDimensions;
|
|
228
|
+
opacity: number;
|
|
225
229
|
width: string;
|
|
226
230
|
}
|
|
227
231
|
export interface VelcronDimensions {
|
package/package.json
CHANGED
package/parser/VelcronStyles.js
CHANGED
|
@@ -11,10 +11,19 @@ class VelcronStyles {
|
|
|
11
11
|
}
|
|
12
12
|
static create(definition, renderCtx) {
|
|
13
13
|
const styleBase = { ...definition.style };
|
|
14
|
+
if (definition.borderRadius) {
|
|
15
|
+
const imageDefinition = definition;
|
|
16
|
+
if (imageDefinition.borderRadius) {
|
|
17
|
+
styleBase["borderTopLeftRadius"] = this.unitProvider.formatDimension(imageDefinition.borderRadius.top);
|
|
18
|
+
styleBase["borderTopRightRadius"] = this.unitProvider.formatDimension(imageDefinition.borderRadius.right);
|
|
19
|
+
styleBase["borderBottomRightRadius"] = this.unitProvider.formatDimension(imageDefinition.borderRadius.bottom);
|
|
20
|
+
styleBase["borderBottomLeftRadius"] = this.unitProvider.formatDimension(imageDefinition.borderRadius.left);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
14
23
|
if (definition.type === VelcronConstants_1.VelcronConstants.components.image) {
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
24
|
+
// if (styleBase.width) {
|
|
25
|
+
// styleBase.width = this.unitProvider.formatDimension(200);
|
|
26
|
+
// }
|
|
18
27
|
// if (!styleBase.height) {
|
|
19
28
|
// styleBase.height = this.unitProvider.formatDimension(400);
|
|
20
29
|
// }
|
|
@@ -30,16 +39,16 @@ class VelcronStyles {
|
|
|
30
39
|
}
|
|
31
40
|
else if (definition.type === VelcronConstants_1.VelcronConstants.components.flexView) {
|
|
32
41
|
const flexViewDefinition = definition;
|
|
33
|
-
const flexGrow = flexViewDefinition.grow ? flexViewDefinition.grow : 1;
|
|
42
|
+
const flexGrow = flexViewDefinition.grow || flexViewDefinition.grow === 0 ? flexViewDefinition.grow : 1;
|
|
34
43
|
styleBase["flex"] = flexGrow;
|
|
35
44
|
styleBase["flexDirection"] = flexViewDefinition.column ? "column" : "row";
|
|
36
45
|
if (flexViewDefinition.width) {
|
|
37
|
-
styleBase["maxWidth"] = flexViewDefinition.width;
|
|
46
|
+
styleBase["maxWidth"] = this.unitProvider.formatDimension(flexViewDefinition.width);
|
|
38
47
|
}
|
|
39
48
|
if (flexViewDefinition.horizontalAlignment) {
|
|
40
49
|
const propertyName = flexViewDefinition.column ? "alignItems" : "justifyContent";
|
|
41
50
|
if (flexViewDefinition.horizontalAlignment === models_1.VelcronHorizontalAlignments.right) {
|
|
42
|
-
styleBase[propertyName] = "
|
|
51
|
+
styleBase[propertyName] = "flex-end";
|
|
43
52
|
}
|
|
44
53
|
else if (flexViewDefinition.horizontalAlignment === models_1.VelcronHorizontalAlignments.center) {
|
|
45
54
|
styleBase[propertyName] = "center";
|
|
@@ -55,23 +64,13 @@ class VelcronStyles {
|
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
else {
|
|
58
|
-
styleBase[propertyName] = "start";
|
|
67
|
+
styleBase[propertyName] = "flex-start";
|
|
59
68
|
}
|
|
60
69
|
if (flexViewDefinition.colorSchema && flexViewDefinition.colorSchema != "") {
|
|
61
70
|
//styleBase["backgroundColor"] = renderCtx.theming.get.activeColorSchema().base.color;
|
|
62
71
|
styleBase["backgroundColor"] = renderCtx.colorSchema.base.color;
|
|
63
72
|
}
|
|
64
|
-
if (flexViewDefinition.borderRadius) {
|
|
65
|
-
styleBase["borderTopLeftRadius"] = this.unitProvider.formatDimension(flexViewDefinition.borderRadius.top);
|
|
66
|
-
styleBase["borderTopRightRadius"] = this.unitProvider.formatDimension(flexViewDefinition.borderRadius.right);
|
|
67
|
-
styleBase["borderBottomRightRadius"] = this.unitProvider.formatDimension(flexViewDefinition.borderRadius.bottom);
|
|
68
|
-
styleBase["borderBottomLeftRadius"] = this.unitProvider.formatDimension(flexViewDefinition.borderRadius.left);
|
|
69
|
-
}
|
|
70
73
|
if (flexViewDefinition.border) {
|
|
71
|
-
styleBase["borderTop"] = this.unitProvider.formatDimension(flexViewDefinition.border.top);
|
|
72
|
-
styleBase["borderRight"] = this.unitProvider.formatDimension(flexViewDefinition.border.right);
|
|
73
|
-
styleBase["borderBottom"] = this.unitProvider.formatDimension(flexViewDefinition.border.bottom);
|
|
74
|
-
styleBase["borderLeft"] = this.unitProvider.formatDimension(flexViewDefinition.border.left);
|
|
75
74
|
styleBase["borderTopStyle"] = "solid";
|
|
76
75
|
styleBase["borderRightStyle"] = "solid";
|
|
77
76
|
styleBase["borderBottomStyle"] = "solid";
|