@omnia/velcron 7.0.518-dev → 7.0.519-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) {
|
|
@@ -166,9 +166,14 @@ export interface VelcronTextDefinition extends VelcronDefinition {
|
|
|
166
166
|
typography?: string;
|
|
167
167
|
events?: VelcronOnPressEvent;
|
|
168
168
|
}
|
|
169
|
+
export declare enum VelcronImageRatios {
|
|
170
|
+
square = 1,
|
|
171
|
+
landscape = 2
|
|
172
|
+
}
|
|
169
173
|
export interface VelcronImageDefinition extends VelcronDefinition {
|
|
170
174
|
type: "Image";
|
|
171
175
|
source: string;
|
|
176
|
+
ratio: VelcronImageRatios;
|
|
172
177
|
events?: VelcronOnPressEvent;
|
|
173
178
|
}
|
|
174
179
|
export interface VelcronButtonDefinition extends VelcronDefinition {
|
|
@@ -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
|
@@ -12,12 +12,12 @@ class VelcronStyles {
|
|
|
12
12
|
static create(definition, renderCtx) {
|
|
13
13
|
const styleBase = { ...definition.style };
|
|
14
14
|
if (definition.type === VelcronConstants_1.VelcronConstants.components.image) {
|
|
15
|
-
if (!styleBase.width) {
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
if (!styleBase.height) {
|
|
19
|
-
|
|
20
|
-
}
|
|
15
|
+
// if (!styleBase.width) {
|
|
16
|
+
// styleBase.width = this.unitProvider.formatDimension(200);
|
|
17
|
+
// }
|
|
18
|
+
// if (!styleBase.height) {
|
|
19
|
+
// styleBase.height = this.unitProvider.formatDimension(400);
|
|
20
|
+
// }
|
|
21
21
|
}
|
|
22
22
|
else if (definition.type === VelcronConstants_1.VelcronConstants.components.text) {
|
|
23
23
|
const textDefinition = definition;
|
|
@@ -37,25 +37,50 @@ class VelcronStyles {
|
|
|
37
37
|
styleBase["maxWidth"] = flexViewDefinition.width;
|
|
38
38
|
}
|
|
39
39
|
if (flexViewDefinition.horizontalAlignment) {
|
|
40
|
+
const propertyName = flexViewDefinition.column ? "alignItems" : "justifyContent";
|
|
40
41
|
if (flexViewDefinition.horizontalAlignment === models_1.VelcronHorizontalAlignments.right) {
|
|
41
|
-
styleBase[
|
|
42
|
+
styleBase[propertyName] = "right";
|
|
42
43
|
}
|
|
43
44
|
else if (flexViewDefinition.horizontalAlignment === models_1.VelcronHorizontalAlignments.center) {
|
|
44
|
-
styleBase[
|
|
45
|
+
styleBase[propertyName] = "center";
|
|
45
46
|
}
|
|
46
47
|
}
|
|
48
|
+
const propertyName = flexViewDefinition.column ? "justifyContent" : "alignItems";
|
|
47
49
|
if (flexViewDefinition.verticalAlignment) {
|
|
48
50
|
if (flexViewDefinition.verticalAlignment === models_1.VerticalAlignments.center) {
|
|
49
|
-
styleBase[
|
|
51
|
+
styleBase[propertyName] = "center";
|
|
50
52
|
}
|
|
51
53
|
else if (flexViewDefinition.verticalAlignment === models_1.VerticalAlignments.bottom) {
|
|
52
|
-
styleBase[
|
|
54
|
+
styleBase[propertyName] = "flex-end";
|
|
53
55
|
}
|
|
54
56
|
}
|
|
57
|
+
else {
|
|
58
|
+
styleBase[propertyName] = "start";
|
|
59
|
+
}
|
|
55
60
|
if (flexViewDefinition.colorSchema && flexViewDefinition.colorSchema != "") {
|
|
56
61
|
//styleBase["backgroundColor"] = renderCtx.theming.get.activeColorSchema().base.color;
|
|
57
62
|
styleBase["backgroundColor"] = renderCtx.colorSchema.base.color;
|
|
58
63
|
}
|
|
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
|
+
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
|
+
styleBase["borderTopStyle"] = "solid";
|
|
76
|
+
styleBase["borderRightStyle"] = "solid";
|
|
77
|
+
styleBase["borderBottomStyle"] = "solid";
|
|
78
|
+
styleBase["borderLeftStyle"] = "solid";
|
|
79
|
+
styleBase["borderTopColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
80
|
+
styleBase["borderRightColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
81
|
+
styleBase["borderBottomColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
82
|
+
styleBase["borderLeftColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
83
|
+
}
|
|
59
84
|
}
|
|
60
85
|
return VelcronStyles.styleProvider(styleBase, definition, renderCtx);
|
|
61
86
|
}
|