@omnia/velcron 8.0.285-dev → 8.0.286-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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Spacing = {
|
|
2
2
|
scale?: "l" | "s";
|
|
3
3
|
top?: SpacingValue;
|
|
4
4
|
right?: SpacingValue;
|
|
5
5
|
bottom?: SpacingValue;
|
|
6
6
|
left?: SpacingValue;
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
export interface SpacingDefinition {
|
|
9
9
|
name: string;
|
|
10
10
|
xs: number;
|
|
@@ -13,7 +13,7 @@ export interface SpacingDefinition {
|
|
|
13
13
|
l: number;
|
|
14
14
|
xl: number;
|
|
15
15
|
}
|
|
16
|
-
export type SpacingValue = "xs" | "s" | "m" | "l" | "xl" | number;
|
|
16
|
+
export type SpacingValue = "xs" | "s" | "m" | "l" | "xl" | "l:xs" | "l:s" | "l:m" | "l:l" | "l:xl" | "s:xs" | "s:s" | "s:m" | "s:l" | "s:xl" | number;
|
|
17
17
|
export declare enum SpacingTypes {
|
|
18
18
|
xs = "xs",
|
|
19
19
|
s = "s",
|
package/package.json
CHANGED
package/parser/VelcronStyles.js
CHANGED
|
@@ -97,21 +97,39 @@ class VelcronStyles {
|
|
|
97
97
|
if (definition.margin) {
|
|
98
98
|
const spacing = renderCtx.theming.get.spacing(definition);
|
|
99
99
|
const margin = VelcronData_1.VelcronData.dataBind(renderCtx, definition.margin);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
if (typeof margin === "object") {
|
|
101
|
+
styleBase["marginTop"] = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, margin.top), spacing));
|
|
102
|
+
styleBase["marginRight"] = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, margin.right), spacing));
|
|
103
|
+
styleBase["marginBottom"] = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, margin.bottom), spacing));
|
|
104
|
+
styleBase["marginLeft"] = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, margin.left), spacing));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const value = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, margin), spacing));
|
|
108
|
+
styleBase["marginTop"] = value;
|
|
109
|
+
styleBase["marginRight"] = value;
|
|
110
|
+
styleBase["marginBottom"] = value;
|
|
111
|
+
styleBase["marginLeft"] = value;
|
|
112
|
+
}
|
|
104
113
|
}
|
|
105
114
|
if (definition.padding) {
|
|
106
115
|
const spacing = renderCtx.theming.get.spacing(definition);
|
|
107
116
|
const padding = VelcronData_1.VelcronData.dataBind(renderCtx, definition.padding);
|
|
108
117
|
// const padding:VelcronSpacing = definition.padding instanceof Object ? definition.padding :
|
|
109
118
|
// VelcronData.getOrSetObjectByPathUsingRenderContext(renderCtx, definition.padding);
|
|
110
|
-
//const padding = VelcronData.dataBind(renderCtx, definition.padding) as any as VelcronDimensions;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
//const padding = VelcronData.dataBind(renderCtx, definition.padding) as any as VelcronDimensions;
|
|
120
|
+
if (typeof padding === "object") {
|
|
121
|
+
styleBase["paddingTop"] = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, padding.top), spacing));
|
|
122
|
+
styleBase["paddingRight"] = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, padding.right), spacing));
|
|
123
|
+
styleBase["paddingBottom"] = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, padding.bottom), spacing));
|
|
124
|
+
styleBase["paddingLeft"] = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, padding.left), spacing));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
const value = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, padding), spacing));
|
|
128
|
+
styleBase["paddingTop"] = value;
|
|
129
|
+
styleBase["paddingRight"] = value;
|
|
130
|
+
styleBase["paddingBottom"] = value;
|
|
131
|
+
styleBase["paddingLeft"] = value;
|
|
132
|
+
}
|
|
115
133
|
}
|
|
116
134
|
if (definition.type === VelcronConstants_1.VelcronConstants.components.velcron) {
|
|
117
135
|
this.applyOverflow(definition, renderCtx, styleBase);
|
|
@@ -169,6 +187,7 @@ class VelcronStyles {
|
|
|
169
187
|
const spacing = renderCtx.theming.get.spacing();
|
|
170
188
|
let alignX = null;
|
|
171
189
|
let alignY = null;
|
|
190
|
+
//const testing = getSpacingValueFromBlueprint(VelcronData.dataBind(renderCtx, flexDefinition.gapX), spacing);
|
|
172
191
|
const gapX = flexDefinition.gapX || flexDefinition?.gapX?.toString() === "0" ? (0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.gapX), spacing) : (0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.gapY), spacing);
|
|
173
192
|
const gapY = flexDefinition.gapY || flexDefinition?.gapY?.toString() === "0" ? (0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.gapY), spacing) : gapX;
|
|
174
193
|
const width = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.width);
|