@omnia/velcron 7.0.518-dev → 7.0.520-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.
package/models/Enums.d.ts
CHANGED
package/models/Enums.js
CHANGED
|
@@ -48,6 +48,7 @@ var VelcronComponentPropertyEditors;
|
|
|
48
48
|
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["slider"] = 2] = "slider";
|
|
49
49
|
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["colorPicker"] = 3] = "colorPicker";
|
|
50
50
|
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["typographyPicker"] = 4] = "typographyPicker";
|
|
51
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["ratioPicker"] = 5] = "ratioPicker";
|
|
51
52
|
})(VelcronComponentPropertyEditors = exports.VelcronComponentPropertyEditors || (exports.VelcronComponentPropertyEditors = {}));
|
|
52
53
|
var VelcronDataTypes;
|
|
53
54
|
(function (VelcronDataTypes) {
|
|
@@ -163,12 +163,20 @@ 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
|
}
|
|
171
|
+
export declare enum VelcronImageRatios {
|
|
172
|
+
square = 1,
|
|
173
|
+
landscape = 2
|
|
174
|
+
}
|
|
169
175
|
export interface VelcronImageDefinition extends VelcronDefinition {
|
|
170
176
|
type: "Image";
|
|
171
177
|
source: string;
|
|
178
|
+
ratio: VelcronImageRatios;
|
|
179
|
+
borderRadius?: VelcronDimensions;
|
|
172
180
|
events?: VelcronOnPressEvent;
|
|
173
181
|
}
|
|
174
182
|
export interface VelcronButtonDefinition extends VelcronDefinition {
|
|
@@ -217,6 +225,7 @@ export interface VelcronFlexViewDefinition extends VelcronDefinition, VelcronCus
|
|
|
217
225
|
grow?: number;
|
|
218
226
|
border?: VelcronBorder;
|
|
219
227
|
borderRadius?: VelcronDimensions;
|
|
228
|
+
opacity: number;
|
|
220
229
|
width: string;
|
|
221
230
|
}
|
|
222
231
|
export interface VelcronDimensions {
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronImageRatios = void 0;
|
|
4
|
+
var VelcronImageRatios;
|
|
5
|
+
(function (VelcronImageRatios) {
|
|
6
|
+
VelcronImageRatios[VelcronImageRatios["square"] = 1] = "square";
|
|
7
|
+
VelcronImageRatios[VelcronImageRatios["landscape"] = 2] = "landscape";
|
|
8
|
+
})(VelcronImageRatios = exports.VelcronImageRatios || (exports.VelcronImageRatios = {}));
|
package/package.json
CHANGED
package/parser/VelcronStyles.js
CHANGED
|
@@ -11,14 +11,23 @@ class VelcronStyles {
|
|
|
11
11
|
}
|
|
12
12
|
static create(definition, renderCtx) {
|
|
13
13
|
const styleBase = { ...definition.style };
|
|
14
|
-
if (definition.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
styleBase
|
|
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);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
23
|
+
if (definition.type === VelcronConstants_1.VelcronConstants.components.image) {
|
|
24
|
+
// if (styleBase.width) {
|
|
25
|
+
// styleBase.width = this.unitProvider.formatDimension(200);
|
|
26
|
+
// }
|
|
27
|
+
// if (!styleBase.height) {
|
|
28
|
+
// styleBase.height = this.unitProvider.formatDimension(400);
|
|
29
|
+
// }
|
|
30
|
+
}
|
|
22
31
|
else if (definition.type === VelcronConstants_1.VelcronConstants.components.text) {
|
|
23
32
|
const textDefinition = definition;
|
|
24
33
|
if (textDefinition.color) {
|
|
@@ -30,32 +39,47 @@ 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) {
|
|
49
|
+
const propertyName = flexViewDefinition.column ? "alignItems" : "justifyContent";
|
|
40
50
|
if (flexViewDefinition.horizontalAlignment === models_1.VelcronHorizontalAlignments.right) {
|
|
41
|
-
styleBase[
|
|
51
|
+
styleBase[propertyName] = "flex-end";
|
|
42
52
|
}
|
|
43
53
|
else if (flexViewDefinition.horizontalAlignment === models_1.VelcronHorizontalAlignments.center) {
|
|
44
|
-
styleBase[
|
|
54
|
+
styleBase[propertyName] = "center";
|
|
45
55
|
}
|
|
46
56
|
}
|
|
57
|
+
const propertyName = flexViewDefinition.column ? "justifyContent" : "alignItems";
|
|
47
58
|
if (flexViewDefinition.verticalAlignment) {
|
|
48
59
|
if (flexViewDefinition.verticalAlignment === models_1.VerticalAlignments.center) {
|
|
49
|
-
styleBase[
|
|
60
|
+
styleBase[propertyName] = "center";
|
|
50
61
|
}
|
|
51
62
|
else if (flexViewDefinition.verticalAlignment === models_1.VerticalAlignments.bottom) {
|
|
52
|
-
styleBase[
|
|
63
|
+
styleBase[propertyName] = "flex-end";
|
|
53
64
|
}
|
|
54
65
|
}
|
|
66
|
+
else {
|
|
67
|
+
styleBase[propertyName] = "flex-start";
|
|
68
|
+
}
|
|
55
69
|
if (flexViewDefinition.colorSchema && flexViewDefinition.colorSchema != "") {
|
|
56
70
|
//styleBase["backgroundColor"] = renderCtx.theming.get.activeColorSchema().base.color;
|
|
57
71
|
styleBase["backgroundColor"] = renderCtx.colorSchema.base.color;
|
|
58
72
|
}
|
|
73
|
+
if (flexViewDefinition.border) {
|
|
74
|
+
styleBase["borderTopStyle"] = "solid";
|
|
75
|
+
styleBase["borderRightStyle"] = "solid";
|
|
76
|
+
styleBase["borderBottomStyle"] = "solid";
|
|
77
|
+
styleBase["borderLeftStyle"] = "solid";
|
|
78
|
+
styleBase["borderTopColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
79
|
+
styleBase["borderRightColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
80
|
+
styleBase["borderBottomColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
81
|
+
styleBase["borderLeftColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
82
|
+
}
|
|
59
83
|
}
|
|
60
84
|
return VelcronStyles.styleProvider(styleBase, definition, renderCtx);
|
|
61
85
|
}
|