@omnia/velcron 8.0.288-dev → 8.0.290-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/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +4 -0
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronDefinition.d.ts +1 -1
- package/models/VelcronDefinitions.d.ts +17 -0
- package/models/VelcronPropertyEditorDefinitions.d.ts +11 -1
- package/package.json +1 -1
- package/parser/VelcronConstants.d.ts +1 -0
- package/parser/VelcronConstants.js +1 -0
- package/parser/VelcronData.js +3 -0
- package/parser/VelcronStyles.js +43 -0
- package/templatebuilder/VelcronEditorBuilder.d.ts +1 -0
- package/templatebuilder/VelcronEditorBuilder.js +8 -0
|
@@ -75,6 +75,10 @@ export interface ThemeDefinitionV2 extends ThemeDefinitionReference {
|
|
|
75
75
|
spacing: SpacingBlueprints;
|
|
76
76
|
components: ComponentBlueprints;
|
|
77
77
|
}
|
|
78
|
+
export interface ThemingSetting {
|
|
79
|
+
adminThemeId?: guid;
|
|
80
|
+
defaultThemeId?: guid;
|
|
81
|
+
}
|
|
78
82
|
export interface ITemplateRegistration<TTemplateType = any> {
|
|
79
83
|
id: guid;
|
|
80
84
|
template: TTemplateType;
|
|
@@ -60,7 +60,7 @@ export interface VelcronComponentDefinition extends VelcronDefinition {
|
|
|
60
60
|
icon?: any;
|
|
61
61
|
}
|
|
62
62
|
export type VelcronCustomComponentDefinition = VelcronComponentDefinition;
|
|
63
|
-
export type BuiltInPropertyEditorType = "text" | "number" | "slider" | "switch" | "alignment" | "color" | "flow" | "icon" | "image" | "typography" | "spacing" | "color-schema-type" | "blueprint" | "background" | "grid" | "reference" | "select" | "property-resolver";
|
|
63
|
+
export type BuiltInPropertyEditorType = "text" | "number" | "slider" | "switch" | "alignment" | "color" | "flow" | "icon" | "image" | "typography" | "spacing" | "color-schema-type" | "blueprint" | "background" | "grid" | "reference" | "select" | "property-resolver" | "link-resolver";
|
|
64
64
|
export type EditorLocation = "inline" | "pane" | "toolbar";
|
|
65
65
|
export interface VelcronEditor<TSettings = any> {
|
|
66
66
|
name?: string;
|
|
@@ -13,6 +13,7 @@ export interface BuiltInComponentRenderers {
|
|
|
13
13
|
"velcron": unknown;
|
|
14
14
|
"flex": unknown;
|
|
15
15
|
"row": unknown;
|
|
16
|
+
"grid": unknown;
|
|
16
17
|
"column": unknown;
|
|
17
18
|
"card": unknown;
|
|
18
19
|
"text": unknown;
|
|
@@ -175,6 +176,17 @@ export interface VelcronFlexDefinition extends VelcronDefinition, VelcronColorSt
|
|
|
175
176
|
events?: VelcronOnPressEvent;
|
|
176
177
|
border?: VelcronBorder;
|
|
177
178
|
borderRadius?: VelcronDimensions;
|
|
179
|
+
width?: number | string;
|
|
180
|
+
minWidth?: number | string;
|
|
181
|
+
height?: number | string;
|
|
182
|
+
minHeight?: number | string;
|
|
183
|
+
}
|
|
184
|
+
export interface VelcronGridDefinition extends VelcronDefinition {
|
|
185
|
+
type: "grid";
|
|
186
|
+
minColumnWidth?: number | string;
|
|
187
|
+
columns?: number | Array<string>;
|
|
188
|
+
gapX?: number | string;
|
|
189
|
+
gapY?: number | string;
|
|
178
190
|
}
|
|
179
191
|
export interface VelcronFlexRowDefinition extends VelcronDefinition, VelcronColorStyling, VelcronDefinitionHasEffects, VelcronDefinitionHasOverflow {
|
|
180
192
|
type: "row";
|
|
@@ -311,6 +323,10 @@ export interface VelcronLottieDefinition extends VelcronDefinition {
|
|
|
311
323
|
direction?: VelcronBindableProp<"normal" | "reverse">;
|
|
312
324
|
hover?: VelcronBindableProp<boolean>;
|
|
313
325
|
}
|
|
326
|
+
export interface VelcronSlidePanelSlidesOptions {
|
|
327
|
+
foreach: string;
|
|
328
|
+
definition: VelcronDefinition;
|
|
329
|
+
}
|
|
314
330
|
export interface VelcronSlidePanelDefinition extends VelcronDefinition {
|
|
315
331
|
type: "slide-panel";
|
|
316
332
|
slidesPerView?: VelcronBindableProp<number>;
|
|
@@ -322,6 +338,7 @@ export interface VelcronSlidePanelDefinition extends VelcronDefinition {
|
|
|
322
338
|
loop?: VelcronBindableProp<boolean>;
|
|
323
339
|
style?: VelcronCardStyling;
|
|
324
340
|
events?: VelcronOnPressEvent;
|
|
341
|
+
slides?: VelcronSlidePanelSlidesOptions;
|
|
325
342
|
}
|
|
326
343
|
export interface VelcronEditorRendererDefinition extends VelcronDefinition {
|
|
327
344
|
type: "editor";
|
|
@@ -36,6 +36,11 @@ export interface VelcronNumberEditorSettings {
|
|
|
36
36
|
max: number;
|
|
37
37
|
step: number;
|
|
38
38
|
}
|
|
39
|
+
export interface VelcronReferencePropertyEditorSettings {
|
|
40
|
+
multiple: boolean;
|
|
41
|
+
min?: number;
|
|
42
|
+
max?: number;
|
|
43
|
+
}
|
|
39
44
|
export interface VelcronPropertyMapping {
|
|
40
45
|
state: string;
|
|
41
46
|
title: string;
|
|
@@ -45,6 +50,8 @@ export interface VelcronPropertyMapping {
|
|
|
45
50
|
export interface VelcronPropertyResolverEditorSettings {
|
|
46
51
|
properties: Array<VelcronPropertyMapping>;
|
|
47
52
|
}
|
|
53
|
+
export interface VelcronLinkResolverEditorSettings {
|
|
54
|
+
}
|
|
48
55
|
export interface VelcronBlueprintEditorSettings {
|
|
49
56
|
type: "container" | "icon" | "button";
|
|
50
57
|
}
|
|
@@ -90,7 +97,7 @@ export interface VelcronImagePropertyEditor extends VelcronEditor<any> {
|
|
|
90
97
|
export interface VelcronSpacingPropertyEditor extends VelcronEditor<VelcronSpacingEditorSettings> {
|
|
91
98
|
type: "spacing";
|
|
92
99
|
}
|
|
93
|
-
export interface VelcronReferencePropertyEditor extends VelcronEditor<
|
|
100
|
+
export interface VelcronReferencePropertyEditor extends VelcronEditor<VelcronReferencePropertyEditorSettings> {
|
|
94
101
|
type: "reference";
|
|
95
102
|
}
|
|
96
103
|
export interface VelcronBlueprintEditor extends VelcronEditor<VelcronBlueprintEditorSettings> {
|
|
@@ -108,3 +115,6 @@ export interface VelcronSelectEditor extends VelcronEditor<VelcronSelectEditorSe
|
|
|
108
115
|
export interface VelcronPropertyResolverEditor extends VelcronEditor<VelcronPropertyResolverEditorSettings> {
|
|
109
116
|
type: "property-resolver";
|
|
110
117
|
}
|
|
118
|
+
export interface VelcronLinkResolverEditor extends VelcronEditor<VelcronLinkResolverEditorSettings> {
|
|
119
|
+
type: "link-resolver";
|
|
120
|
+
}
|
package/package.json
CHANGED
package/parser/VelcronData.js
CHANGED
|
@@ -25,6 +25,9 @@ class VelcronData {
|
|
|
25
25
|
else if (bindTo === VelcronConstants_1.VelcronConstants.context.activeToken) {
|
|
26
26
|
return renderContext.$active;
|
|
27
27
|
}
|
|
28
|
+
else if (bindTo === VelcronConstants_1.VelcronConstants.context.thisToken) {
|
|
29
|
+
return renderContext.currentContext;
|
|
30
|
+
}
|
|
28
31
|
//String interpolation > {{ $state.title }} and {{ $state.description }}
|
|
29
32
|
const tokens = this.getTokens(bindTo, false);
|
|
30
33
|
tokens.forEach((token) => {
|
package/parser/VelcronStyles.js
CHANGED
|
@@ -182,6 +182,15 @@ class VelcronStyles {
|
|
|
182
182
|
styleBase["boxSizing"] = "border-box";
|
|
183
183
|
this.applyOverflow(definition, renderCtx, styleBase);
|
|
184
184
|
this.insertBackgroundColor(styleBase, flexDefinition, renderCtx);
|
|
185
|
+
const width = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.width);
|
|
186
|
+
const minWidth = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.minWidth);
|
|
187
|
+
const height = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.height);
|
|
188
|
+
const minHeight = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.minHeight);
|
|
189
|
+
styleBase["width"] = this.unitProvider.formatDimension(width);
|
|
190
|
+
styleBase["maxWidth"] = this.unitProvider.formatDimension(width);
|
|
191
|
+
styleBase["minWidth"] = this.unitProvider.formatDimension(minWidth);
|
|
192
|
+
styleBase["height"] = this.unitProvider.formatDimension(height);
|
|
193
|
+
styleBase["minHeight"] = this.unitProvider.formatDimension(minHeight);
|
|
185
194
|
}
|
|
186
195
|
else if (definition.type === VelcronConstants_1.VelcronConstants.components.row) {
|
|
187
196
|
const flexDefinition = definition;
|
|
@@ -267,6 +276,40 @@ class VelcronStyles {
|
|
|
267
276
|
styleBase["minWidth"] = this.unitProvider.formatDimension(minWidth);
|
|
268
277
|
this.insertBackgroundColor(styleBase, flexDefinition, renderCtx);
|
|
269
278
|
}
|
|
279
|
+
else if (definition.type === VelcronConstants_1.VelcronConstants.components.grid) {
|
|
280
|
+
const spacingBlueprint = renderCtx.theming.get.spacing();
|
|
281
|
+
const flexDefinition = definition;
|
|
282
|
+
const columns = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.columns);
|
|
283
|
+
const minWidth = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.minColumnWidth);
|
|
284
|
+
const gapX = flexDefinition.gapX || flexDefinition?.gapX?.toString() === "0" ?
|
|
285
|
+
(0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.gapX), spacingBlueprint) :
|
|
286
|
+
(0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.gapY), spacingBlueprint);
|
|
287
|
+
const gapY = flexDefinition.gapY || flexDefinition?.gapY?.toString() === "0" ?
|
|
288
|
+
(0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.gapY), spacingBlueprint) :
|
|
289
|
+
gapX;
|
|
290
|
+
styleBase["display"] = "grid";
|
|
291
|
+
if (minWidth) {
|
|
292
|
+
const widthWithDimension = this.unitProvider.formatDimension(minWidth);
|
|
293
|
+
styleBase["gridTemplateColumns"] = `repeat(auto-fit,minmax(${widthWithDimension}, 1fr))`;
|
|
294
|
+
}
|
|
295
|
+
else if (columns) {
|
|
296
|
+
let templateColumnString = "";
|
|
297
|
+
if (VelcronData_1.VelcronData.isArray(columns)) {
|
|
298
|
+
columns.forEach((col) => {
|
|
299
|
+
templateColumnString += `${col} `;
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
const columnNumber = Number.parseInt(columns);
|
|
304
|
+
for (let i = 0; i < columnNumber; i++) {
|
|
305
|
+
templateColumnString += "1fr ";
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
styleBase["gridTemplateColumns"] = templateColumnString;
|
|
309
|
+
}
|
|
310
|
+
styleBase["rowGap"] = this.unitProvider.formatDimension(gapY);
|
|
311
|
+
styleBase["columnGap"] = this.unitProvider.formatDimension(gapX);
|
|
312
|
+
}
|
|
270
313
|
if (definition.border) {
|
|
271
314
|
const typedDefinition = definition;
|
|
272
315
|
this.insertBorderStyles(styleBase, typedDefinition.border, renderCtx);
|
|
@@ -16,6 +16,7 @@ export declare class VelcronEditorBuilder {
|
|
|
16
16
|
gridEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
|
|
17
17
|
widthEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
|
|
18
18
|
propertyResolverEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
|
|
19
|
+
linkResolverEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
|
|
19
20
|
};
|
|
20
21
|
build(): VelcronEditor<any>[];
|
|
21
22
|
}
|
|
@@ -142,6 +142,14 @@ class VelcronEditorBuilder {
|
|
|
142
142
|
state: this.formatStateMapping(stateMapping),
|
|
143
143
|
});
|
|
144
144
|
return this;
|
|
145
|
+
},
|
|
146
|
+
linkResolverEditor: (name, stateMapping) => {
|
|
147
|
+
this.editors.push({
|
|
148
|
+
name: name,
|
|
149
|
+
type: "link-resolver",
|
|
150
|
+
state: this.formatStateMapping(stateMapping),
|
|
151
|
+
});
|
|
152
|
+
return this;
|
|
145
153
|
}
|
|
146
154
|
};
|
|
147
155
|
}
|