@omnia/fx-models 8.0.286-dev → 8.0.287-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/Layout.d.ts +10 -8
- package/internal-do-not-import-from-here/shared/models/ShortId.d.ts +6 -0
- package/internal-do-not-import-from-here/shared/models/ShortId.js +12 -0
- package/internal-do-not-import-from-here/shared/models/index.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/models/index.js +1 -0
- package/internal-do-not-import-from-here/shared/models/theming/Blueprints.d.ts +2 -3
- package/internal-do-not-import-from-here/shared/models/theming/SharedBlueprintMethods.d.ts +3 -2
- package/internal-do-not-import-from-here/shared/models/theming/SharedBlueprintMethods.js +27 -8
- package/internal-do-not-import-from-here/shared/models/theming/Spacing.d.ts +2 -1
- package/internal-do-not-import-from-here/shared/models/theming/index.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/models/theming/index.js +1 -0
- package/internal-do-not-import-from-here/shared/models/theming/useSpacingScaling.d.ts +15 -0
- package/internal-do-not-import-from-here/shared/models/theming/useSpacingScaling.js +88 -0
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronDefinition.d.ts +2 -2
- package/internal-do-not-import-from-here/velcron/core/models/Enums.d.ts +1 -2
- package/internal-do-not-import-from-here/velcron/core/models/Enums.js +0 -2
- package/internal-do-not-import-from-here/velcron/core/models/VelcronDefinitions.d.ts +3 -2
- package/internal-do-not-import-from-here/velcron/core/models/VelcronTypes.d.ts +1 -1
- package/package.json +1 -1
package/Layout.d.ts
CHANGED
@@ -144,10 +144,11 @@ export interface SectionSettings extends LayoutItemSettings {
|
|
144
144
|
spacingBlock: SpacingValue;
|
145
145
|
spacingColumn: SpacingValue;
|
146
146
|
minWidthBlock: string;
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
147
|
+
margin?: Spacing;
|
148
|
+
marginSectionLeft?: SpacingValue;
|
149
|
+
marginSectionRight?: SpacingValue;
|
150
|
+
marginSectionTop?: SpacingValue;
|
151
|
+
marginSectionBottom?: SpacingValue;
|
151
152
|
targetingFilterProperties: TargetingFilterProperty;
|
152
153
|
anchorName?: string;
|
153
154
|
titleSettings?: BlockTitleSettings;
|
@@ -264,10 +265,11 @@ export interface HeaderItemSettings {
|
|
264
265
|
titleRenderer?: TitleRendererValue;
|
265
266
|
}
|
266
267
|
export interface SpacingItemSettings {
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
268
|
+
padding: Spacing;
|
269
|
+
paddingRight?: number | SpacingValue;
|
270
|
+
paddingLeft?: number | SpacingValue;
|
271
|
+
paddingTop?: number | SpacingValue;
|
272
|
+
paddingBottom?: number | SpacingValue;
|
271
273
|
minHeight: string;
|
272
274
|
}
|
273
275
|
export interface StyleItemSettings {
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.shortId = shortId;
|
4
|
+
const Guid_1 = require("./Guid");
|
5
|
+
/**
|
6
|
+
* Generates a short ID.
|
7
|
+
*
|
8
|
+
* @returns {string} The generated short ID.
|
9
|
+
*/
|
10
|
+
function shortId() {
|
11
|
+
return (0, Guid_1.guid)().replace("-", "").substring(0, 8);
|
12
|
+
}
|
@@ -24,3 +24,4 @@ tslib_1.__exportStar(require("./velcron"), exports);
|
|
24
24
|
tslib_1.__exportStar(require("./DependencyInjection"), exports);
|
25
25
|
tslib_1.__exportStar(require("./Messaging"), exports);
|
26
26
|
tslib_1.__exportStar(require("./EventHook"), exports);
|
27
|
+
tslib_1.__exportStar(require("./ShortId"), exports);
|
@@ -56,10 +56,9 @@ export interface ComponentBlueprints extends Blueprints, BlueprintsReference {
|
|
56
56
|
containers?: ContainerBlueprints;
|
57
57
|
}
|
58
58
|
export interface SpacingBlueprint {
|
59
|
-
|
60
|
-
|
59
|
+
l: SpacingDefinition;
|
60
|
+
s: SpacingDefinition;
|
61
61
|
}
|
62
|
-
export type SpacingBlueprintTypes = "inner" | "layout";
|
63
62
|
export type WebBlueprintItemDefintionType = "button" | "searchbox" | "text" | "icon" | "tab";
|
64
63
|
export declare enum WebBlueprintItemDefintionTypes {
|
65
64
|
button = "button",
|
@@ -1,2 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { SpacingBlueprint } from "./Blueprints";
|
2
|
+
import { SpacingScale } from "./Spacing";
|
3
|
+
export declare function getSpacingValueFromBlueprint(spacingValue: any, blueprint: SpacingBlueprint, scale?: SpacingScale): number;
|
@@ -3,30 +3,49 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
4
|
exports.getSpacingValueFromBlueprint = getSpacingValueFromBlueprint;
|
5
5
|
const Spacing_1 = require("./Spacing");
|
6
|
-
|
6
|
+
const useSpacingScaling_1 = require("./useSpacingScaling");
|
7
|
+
const spacingScaling = (0, useSpacingScaling_1.useSpacingScaling)();
|
8
|
+
function getValueWithoutScale(value) {
|
9
|
+
if (!value) {
|
10
|
+
return value;
|
11
|
+
}
|
12
|
+
if (typeof value === "number") {
|
13
|
+
return value;
|
14
|
+
}
|
15
|
+
if (value.indexOf(":") === -1) {
|
16
|
+
return value;
|
17
|
+
}
|
18
|
+
return value.split(":")[1];
|
19
|
+
}
|
20
|
+
function getSpacingValueFromBlueprint(spacingValue, blueprint, scale) {
|
7
21
|
if (!spacingValue) {
|
8
22
|
return 0;
|
9
23
|
}
|
24
|
+
if (!scale) {
|
25
|
+
scale = spacingScaling.get.scale(spacingValue);
|
26
|
+
}
|
27
|
+
const definition = scale === "l" ? blueprint.l : blueprint.s;
|
10
28
|
let negative = false;
|
11
29
|
let result = spacingValue;
|
12
30
|
if (isNaN(spacingValue) && definition) {
|
13
|
-
|
31
|
+
let strippedValue = getValueWithoutScale(spacingValue);
|
32
|
+
if (strippedValue.startsWith("-")) {
|
14
33
|
negative = true;
|
15
34
|
}
|
16
|
-
|
17
|
-
if (
|
35
|
+
strippedValue = strippedValue.replace("-", "");
|
36
|
+
if (strippedValue === Spacing_1.SpacingTypes.xs) {
|
18
37
|
result = definition.xs;
|
19
38
|
}
|
20
|
-
else if (
|
39
|
+
else if (strippedValue === Spacing_1.SpacingTypes.s) {
|
21
40
|
result = definition.s;
|
22
41
|
}
|
23
|
-
else if (
|
42
|
+
else if (strippedValue === Spacing_1.SpacingTypes.m) {
|
24
43
|
result = definition.m;
|
25
44
|
}
|
26
|
-
else if (
|
45
|
+
else if (strippedValue === Spacing_1.SpacingTypes.l) {
|
27
46
|
result = definition.l;
|
28
47
|
}
|
29
|
-
else if (
|
48
|
+
else if (strippedValue === Spacing_1.SpacingTypes.xl) {
|
30
49
|
result = definition.xl;
|
31
50
|
}
|
32
51
|
else {
|
@@ -1,10 +1,11 @@
|
|
1
1
|
export type Spacing = {
|
2
|
-
scale?:
|
2
|
+
scale?: SpacingScale;
|
3
3
|
top?: SpacingValue;
|
4
4
|
right?: SpacingValue;
|
5
5
|
bottom?: SpacingValue;
|
6
6
|
left?: SpacingValue;
|
7
7
|
};
|
8
|
+
export type SpacingScale = "l" | "s";
|
8
9
|
export interface SpacingDefinition {
|
9
10
|
name: string;
|
10
11
|
xs: number;
|
@@ -9,3 +9,4 @@ tslib_1.__exportStar(require("./Spacing"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./SharedBlueprintMethods"), exports);
|
10
10
|
tslib_1.__exportStar(require("./SharedColorMethods"), exports);
|
11
11
|
tslib_1.__exportStar(require("./Blueprints"), exports);
|
12
|
+
tslib_1.__exportStar(require("./useSpacingScaling"), exports);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Spacing, SpacingScale, SpacingValue } from "@omnia/fx-models";
|
2
|
+
export declare function useSpacingScaling(): {
|
3
|
+
get: {
|
4
|
+
valueWithoutScale: (value: SpacingValue) => string | number;
|
5
|
+
scaleFromValue: (value: SpacingValue) => SpacingScale;
|
6
|
+
scale: (value: Spacing | SpacingValue) => SpacingScale;
|
7
|
+
};
|
8
|
+
add: {
|
9
|
+
scaleToValue: (value: SpacingValue, scale: SpacingScale) => string | number;
|
10
|
+
fallBackScale: (value: SpacingValue, scale: SpacingScale) => string | number;
|
11
|
+
};
|
12
|
+
has: {
|
13
|
+
scaling: (value: SpacingValue) => boolean;
|
14
|
+
};
|
15
|
+
};
|
@@ -0,0 +1,88 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.useSpacingScaling = useSpacingScaling;
|
4
|
+
function useSpacingScaling() {
|
5
|
+
function getValueWithoutScale(value) {
|
6
|
+
if (!value) {
|
7
|
+
return value;
|
8
|
+
}
|
9
|
+
if (typeof value === "number") {
|
10
|
+
return value;
|
11
|
+
}
|
12
|
+
if (!value.indexOf) {
|
13
|
+
return value;
|
14
|
+
}
|
15
|
+
if (value.indexOf(":") === -1) {
|
16
|
+
return value;
|
17
|
+
}
|
18
|
+
return value.split(":")[1];
|
19
|
+
}
|
20
|
+
function getScaleFromValue(value) {
|
21
|
+
if (!value) {
|
22
|
+
return value;
|
23
|
+
}
|
24
|
+
if (typeof value === "number") {
|
25
|
+
return value;
|
26
|
+
}
|
27
|
+
if (value.indexOf(":") === -1) {
|
28
|
+
return undefined;
|
29
|
+
}
|
30
|
+
return value.split(":")[0];
|
31
|
+
}
|
32
|
+
function addScaleToValue(value, scale) {
|
33
|
+
if (!scale) {
|
34
|
+
return value;
|
35
|
+
}
|
36
|
+
if (!value) {
|
37
|
+
return value;
|
38
|
+
}
|
39
|
+
if (typeof value === "number") {
|
40
|
+
return value;
|
41
|
+
}
|
42
|
+
if (value.indexOf(":") > -1) {
|
43
|
+
return `${scale}:${value.split(":")[1]}`;
|
44
|
+
}
|
45
|
+
return `${scale}:${value}`;
|
46
|
+
}
|
47
|
+
function hasScaling(value) {
|
48
|
+
if (!value) {
|
49
|
+
return false;
|
50
|
+
}
|
51
|
+
if (typeof value === "number") {
|
52
|
+
return false;
|
53
|
+
}
|
54
|
+
if (value.indexOf(":") > -1) {
|
55
|
+
return true;
|
56
|
+
}
|
57
|
+
return false;
|
58
|
+
}
|
59
|
+
function getScale(value) {
|
60
|
+
if (!value) {
|
61
|
+
return undefined;
|
62
|
+
}
|
63
|
+
if (typeof value === "object") {
|
64
|
+
return value.scale;
|
65
|
+
}
|
66
|
+
return getScaleFromValue(value);
|
67
|
+
}
|
68
|
+
function setScaleIfEmpty(value, scale) {
|
69
|
+
if (hasScaling(value)) {
|
70
|
+
return value;
|
71
|
+
}
|
72
|
+
return addScaleToValue(value, scale);
|
73
|
+
}
|
74
|
+
return {
|
75
|
+
get: {
|
76
|
+
valueWithoutScale: getValueWithoutScale,
|
77
|
+
scaleFromValue: getScaleFromValue,
|
78
|
+
scale: getScale
|
79
|
+
},
|
80
|
+
add: {
|
81
|
+
scaleToValue: addScaleToValue,
|
82
|
+
fallBackScale: setScaleIfEmpty
|
83
|
+
},
|
84
|
+
has: {
|
85
|
+
scaling: hasScaling
|
86
|
+
}
|
87
|
+
};
|
88
|
+
}
|
@@ -25,17 +25,17 @@ export interface VelcronDefinition extends VelcronDefinitionBase, VelcronDimensi
|
|
25
25
|
if?: string;
|
26
26
|
events?: VelcronEvent;
|
27
27
|
}
|
28
|
+
export type VelcronSpacingScale = "l" | "s";
|
28
29
|
export interface VelcronSpacing {
|
30
|
+
scale?: VelcronSpacingScale;
|
29
31
|
top?: number | string;
|
30
32
|
right?: number | string;
|
31
33
|
bottom?: number | string;
|
32
34
|
left?: number | string;
|
33
35
|
}
|
34
|
-
export type VelcronSpacingTypes = "inner" | "layout";
|
35
36
|
interface VelcronDimensionStyling {
|
36
37
|
margin?: VelcronSpacing;
|
37
38
|
padding?: VelcronSpacing;
|
38
|
-
spacingType?: VelcronSpacingTypes;
|
39
39
|
}
|
40
40
|
export interface VelcronStyling {
|
41
41
|
margin?: string;
|
@@ -32,6 +32,4 @@ var VelcronDataTypes;
|
|
32
32
|
VelcronDataTypes["boolean"] = "boolean";
|
33
33
|
VelcronDataTypes["array"] = "array";
|
34
34
|
VelcronDataTypes["componentArray"] = "componentArray";
|
35
|
-
//Depricated????
|
36
|
-
VelcronDataTypes["bind"] = "bind";
|
37
35
|
})(VelcronDataTypes || (exports.VelcronDataTypes = VelcronDataTypes = {}));
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference, EventHook, Future, TextBlueprint, VelcronBindableProp, VelcronEditor, ContainerBlueprint, BackgroundDefinition, ContainerVariant, IconBlueprint, ButtonBlueprint } from "@omnia/fx-models/internal-do-not-import-from-here/shared/models";
|
2
|
-
import {
|
2
|
+
import { VelcronComponentArrayType, VelcronPrimitiveType } from "./VelcronTypes";
|
3
3
|
import { AssignOperators, VelcronHorizontalAlignments, VelcronIconTypes, VelcronActionTypes, VelcronVerticalAlignments } from "./Enums";
|
4
4
|
import { DynamicState, VelcronDefinition, VelcronEffects, useVelcronThemingStore } from "..";
|
5
5
|
import { guid, PropertyConfiguration, PropertyValue, PropertyDefinition, PropertySetupBase } from "@omnia/fx/models";
|
@@ -65,7 +65,7 @@ export interface VelcronRenderContext {
|
|
65
65
|
};
|
66
66
|
components?: Array<VelcronCustomComponentDefinition>;
|
67
67
|
properties?: {
|
68
|
-
[name: string]: VelcronPrimitiveType |
|
68
|
+
[name: string]: VelcronPrimitiveType | VelcronComponentArrayType;
|
69
69
|
};
|
70
70
|
computed?: {
|
71
71
|
[name: string]: Array<string>;
|
@@ -314,6 +314,7 @@ export interface VelcronLottieDefinition extends VelcronDefinition {
|
|
314
314
|
export interface VelcronSlidePanelDefinition extends VelcronDefinition {
|
315
315
|
type: "slide-panel";
|
316
316
|
slidesPerView?: VelcronBindableProp<number>;
|
317
|
+
delay?: VelcronBindableProp<number>;
|
317
318
|
pagination?: VelcronBindableProp<boolean>;
|
318
319
|
navigation?: VelcronBindableProp<boolean>;
|
319
320
|
scrollbar?: VelcronBindableProp<boolean>;
|
@@ -2,4 +2,4 @@ import { VelcronDefinition } from "@omnia/fx-models";
|
|
2
2
|
export type VelcronPrimitiveType = string | number | boolean;
|
3
3
|
export type VelcronArrayType<T> = Array<T>;
|
4
4
|
export type VelcronObjectType<T extends Object> = T;
|
5
|
-
export type
|
5
|
+
export type VelcronComponentArrayType = Array<VelcronDefinition>;
|