@omnia/velcron 7.0.499-dev → 7.0.501-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/index.d.ts +2 -0
- package/index.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Bring.d.ts +23 -0
- package/internal-do-not-import-from-here/shared/models/Bring.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Broadcasting.d.ts +25 -0
- package/internal-do-not-import-from-here/shared/models/Broadcasting.js +12 -0
- package/internal-do-not-import-from-here/shared/models/Future.d.ts +44 -0
- package/internal-do-not-import-from-here/shared/models/Future.js +122 -0
- package/internal-do-not-import-from-here/shared/models/Guid.d.ts +17 -0
- package/internal-do-not-import-from-here/shared/models/Guid.js +51 -0
- package/internal-do-not-import-from-here/shared/models/OmniaSharedBootstrapData.d.ts +25 -0
- package/internal-do-not-import-from-here/shared/models/OmniaSharedBootstrapData.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Realtime.d.ts +40 -0
- package/internal-do-not-import-from-here/shared/models/Realtime.js +40 -0
- package/internal-do-not-import-from-here/shared/models/SharedConstants.d.ts +5 -0
- package/internal-do-not-import-from-here/shared/models/SharedConstants.js +9 -0
- package/internal-do-not-import-from-here/shared/models/StringExtensions.d.ts +6 -0
- package/internal-do-not-import-from-here/shared/models/StringExtensions.js +3 -0
- package/internal-do-not-import-from-here/shared/models/Tenant.d.ts +4 -0
- package/internal-do-not-import-from-here/shared/models/Tenant.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Tokens.d.ts +13 -0
- package/internal-do-not-import-from-here/shared/models/Tokens.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Topic.d.ts +10 -0
- package/internal-do-not-import-from-here/shared/models/Topic.js +2 -0
- package/internal-do-not-import-from-here/shared/models/WorkerProxyFuncs.d.ts +8 -0
- package/internal-do-not-import-from-here/shared/models/WorkerProxyFuncs.js +14 -0
- package/internal-do-not-import-from-here/shared/models/Workers.d.ts +29 -0
- package/internal-do-not-import-from-here/shared/models/Workers.js +8 -0
- package/internal-do-not-import-from-here/shared/models/index.d.ts +14 -0
- package/internal-do-not-import-from-here/shared/models/index.js +18 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +60 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.js +24 -0
- package/internal-do-not-import-from-here/shared/models/theming/TypographyDefinition.d.ts +29 -0
- package/internal-do-not-import-from-here/shared/models/theming/TypographyDefinition.js +11 -0
- package/internal-do-not-import-from-here/shared/models/theming/index.d.ts +2 -0
- package/internal-do-not-import-from-here/shared/models/theming/index.js +5 -0
- package/models/Enums.d.ts +4 -2
- package/models/Enums.js +3 -1
- package/models/VelcronDefinitions.d.ts +4 -2
- package/package.json +1 -1
- package/parser/VelcronData.d.ts +1 -1
- package/parser/VelcronData.js +4 -4
- package/parser/VelcronStyles.d.ts +10 -0
- package/parser/VelcronStyles.js +52 -23
- package/stores/VelcronStore.d.ts +12 -0
- package/stores/VelcronStore.js +26 -0
- package/stores/index.d.ts +1 -0
- package/stores/index.js +4 -0
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -4,3 +4,5 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./models"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./parser"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./actions"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./stores"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("@omnia/velcron/internal-do-not-import-from-here/shared/models"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type BringMethods = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
|
|
2
|
+
export type BringCacheOptions = "no-cache" | "reload" | "force-cache" | "only-if-cached";
|
|
3
|
+
export type BringCredentials = "include" | "omit" | "same-origin";
|
|
4
|
+
export interface BringInterceptOptions {
|
|
5
|
+
beforeRequest?: (request: BringConfig) => BringConfig;
|
|
6
|
+
afterRequest?: <T>(response: BringResponse<T>, request: BringConfig) => BringResponse<T>;
|
|
7
|
+
}
|
|
8
|
+
export interface BringConfig {
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
headers?: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
};
|
|
13
|
+
cache?: BringCacheOptions;
|
|
14
|
+
interceptors?: BringInterceptOptions;
|
|
15
|
+
abortable?: boolean;
|
|
16
|
+
credentials?: BringCredentials;
|
|
17
|
+
}
|
|
18
|
+
export interface BringResponse<TData> {
|
|
19
|
+
data?: TData;
|
|
20
|
+
status: Number;
|
|
21
|
+
statusText: String;
|
|
22
|
+
ok: Boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Topic } from "./Topic";
|
|
2
|
+
export declare enum BroadcastTopicScopes {
|
|
3
|
+
localUi = "localUi",
|
|
4
|
+
localWorker = "localWorker",
|
|
5
|
+
localAll = "localAll",
|
|
6
|
+
globalUi = "globalUi",
|
|
7
|
+
globalWorker = "globalWorker",
|
|
8
|
+
globalAll = "globalAll"
|
|
9
|
+
}
|
|
10
|
+
export interface BroadcastTopic<TMessage> extends Topic<TMessage> {
|
|
11
|
+
scope: BroadcastTopicScopes;
|
|
12
|
+
}
|
|
13
|
+
export interface BroadcastInvokeTopic<TMessage, TReturnValue> extends Topic<TMessage> {
|
|
14
|
+
scope: BroadcastTopicScopes;
|
|
15
|
+
}
|
|
16
|
+
export interface BroadcastMessage<TMessage> extends BroadcastTopic<TMessage> {
|
|
17
|
+
message: TMessage;
|
|
18
|
+
}
|
|
19
|
+
export interface BroadcastInvokeMessage<TMessage, TReturnValue> extends BroadcastInvokeTopic<TMessage, TReturnValue> {
|
|
20
|
+
messageId: string;
|
|
21
|
+
message: TMessage;
|
|
22
|
+
type: "request" | "response";
|
|
23
|
+
error?: string;
|
|
24
|
+
response?: TReturnValue;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BroadcastTopicScopes = void 0;
|
|
4
|
+
var BroadcastTopicScopes;
|
|
5
|
+
(function (BroadcastTopicScopes) {
|
|
6
|
+
BroadcastTopicScopes["localUi"] = "localUi";
|
|
7
|
+
BroadcastTopicScopes["localWorker"] = "localWorker";
|
|
8
|
+
BroadcastTopicScopes["localAll"] = "localAll";
|
|
9
|
+
BroadcastTopicScopes["globalUi"] = "globalUi";
|
|
10
|
+
BroadcastTopicScopes["globalWorker"] = "globalWorker";
|
|
11
|
+
BroadcastTopicScopes["globalAll"] = "globalAll";
|
|
12
|
+
})(BroadcastTopicScopes = exports.BroadcastTopicScopes || (exports.BroadcastTopicScopes = {}));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare class Future<T> extends Promise<T> {
|
|
2
|
+
resolve: (value: T) => void;
|
|
3
|
+
reject: (reason: any) => void;
|
|
4
|
+
resolving: boolean;
|
|
5
|
+
private _resolved;
|
|
6
|
+
private _rejected;
|
|
7
|
+
private onAborted;
|
|
8
|
+
constructor(executor: (resolve: (value: T) => void, reject: (reason?: any) => void, onAborted: (cb: (reason?: any) => void) => void) => void);
|
|
9
|
+
/**
|
|
10
|
+
* Handles success / rejection from Promise and returns the result as an object.
|
|
11
|
+
* If the promise is rejected, the error will be in the error property.
|
|
12
|
+
* No need to try/catch the promise when using this method.
|
|
13
|
+
*
|
|
14
|
+
* @return {*} {Future<{ success?: T, error?: Error; }>}
|
|
15
|
+
* @memberof Future
|
|
16
|
+
*/
|
|
17
|
+
tryCatch(): Future<[success: T, error: Error]>;
|
|
18
|
+
/**
|
|
19
|
+
* Aborts the request
|
|
20
|
+
*
|
|
21
|
+
* @param {*} [reason]
|
|
22
|
+
* @memberof Future
|
|
23
|
+
*/
|
|
24
|
+
abort(reason?: any): void;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a Promise that is resolved with an array of results when all of the provided Promises
|
|
27
|
+
* resolve, or rejected when any Promise is rejected.
|
|
28
|
+
* @param values An array of Promises.
|
|
29
|
+
* @returns A new Promise.
|
|
30
|
+
*/
|
|
31
|
+
static all<T extends readonly unknown[] | []>(values: T): Promise<{
|
|
32
|
+
-readonly [P in keyof T]: Awaited<T[P]>;
|
|
33
|
+
}>;
|
|
34
|
+
get resolved(): boolean;
|
|
35
|
+
get rejected(): boolean;
|
|
36
|
+
static get [Symbol.species](): PromiseConstructor;
|
|
37
|
+
get [Symbol.toStringTag](): string;
|
|
38
|
+
static new<TReturnValue>(): Future<TReturnValue>;
|
|
39
|
+
}
|
|
40
|
+
export declare class ResponsePromise<T> extends Promise<T> {
|
|
41
|
+
cancelCb: (() => void);
|
|
42
|
+
constructor(executor: any);
|
|
43
|
+
cancel(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResponsePromise = exports.Future = void 0;
|
|
4
|
+
class Future extends Promise {
|
|
5
|
+
constructor(executor) {
|
|
6
|
+
let resolveLocal;
|
|
7
|
+
let rejectLocal;
|
|
8
|
+
const onAborted = (cb) => {
|
|
9
|
+
setTimeout(() => {
|
|
10
|
+
this.onAborted = cb;
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
const exec = (resolve, reject) => {
|
|
14
|
+
// assign to local to prevent error assignbefore call super;
|
|
15
|
+
resolveLocal = resolve;
|
|
16
|
+
rejectLocal = reject;
|
|
17
|
+
};
|
|
18
|
+
super(exec);
|
|
19
|
+
this.resolving = false;
|
|
20
|
+
this._resolved = false;
|
|
21
|
+
this._rejected = false;
|
|
22
|
+
this.resolve = (value) => {
|
|
23
|
+
this.resolving = false;
|
|
24
|
+
this._resolved = true;
|
|
25
|
+
resolveLocal(value);
|
|
26
|
+
};
|
|
27
|
+
this.reject = (reason) => {
|
|
28
|
+
this.resolving = false;
|
|
29
|
+
this._rejected = true;
|
|
30
|
+
rejectLocal(reason);
|
|
31
|
+
};
|
|
32
|
+
if (executor) {
|
|
33
|
+
executor(this.resolve, this.reject, onAborted);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Handles success / rejection from Promise and returns the result as an object.
|
|
38
|
+
* If the promise is rejected, the error will be in the error property.
|
|
39
|
+
* No need to try/catch the promise when using this method.
|
|
40
|
+
*
|
|
41
|
+
* @return {*} {Future<{ success?: T, error?: Error; }>}
|
|
42
|
+
* @memberof Future
|
|
43
|
+
*/
|
|
44
|
+
//tryCatch(): Future<{ success?: T, error?: Error; }> {
|
|
45
|
+
tryCatch() {
|
|
46
|
+
return new Future(async (resolve) => {
|
|
47
|
+
try {
|
|
48
|
+
const data = await this;
|
|
49
|
+
resolve([data, undefined]);
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
resolve([undefined, err]);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Aborts the request
|
|
58
|
+
*
|
|
59
|
+
* @param {*} [reason]
|
|
60
|
+
* @memberof Future
|
|
61
|
+
*/
|
|
62
|
+
abort(reason) {
|
|
63
|
+
if (this.onAborted) {
|
|
64
|
+
this.onAborted(reason);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
throw "Failed calling abort() => The future has no onAborted callback or you tried to call abort immediately after the future was created.";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Creates a Promise that is resolved with an array of results when all of the provided Promises
|
|
72
|
+
* resolve, or rejected when any Promise is rejected.
|
|
73
|
+
* @param values An array of Promises.
|
|
74
|
+
* @returns A new Promise.
|
|
75
|
+
*/
|
|
76
|
+
static all(values) {
|
|
77
|
+
// have issue with Promise.all not working when promises is mixin Future and promise
|
|
78
|
+
// so implement Future.all to make a wrapper promise to Future to resolve that issue.
|
|
79
|
+
const promises = values.map(p => p instanceof Future ? new Promise((resolve, reject) => p.then(resolve, reject)) : p);
|
|
80
|
+
return Promise.all(promises);
|
|
81
|
+
}
|
|
82
|
+
get resolved() {
|
|
83
|
+
return this._resolved;
|
|
84
|
+
}
|
|
85
|
+
get rejected() {
|
|
86
|
+
return this._rejected;
|
|
87
|
+
}
|
|
88
|
+
static get [Symbol.species]() {
|
|
89
|
+
return Promise;
|
|
90
|
+
}
|
|
91
|
+
get [Symbol.toStringTag]() {
|
|
92
|
+
// return Object value to make vue can build get/set reactive.
|
|
93
|
+
return "Object";
|
|
94
|
+
}
|
|
95
|
+
static new() {
|
|
96
|
+
return new Future(() => { });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.Future = Future;
|
|
100
|
+
class ResponsePromise extends Promise {
|
|
101
|
+
constructor(executor) {
|
|
102
|
+
const onCancel = (cb) => {
|
|
103
|
+
//using nextTick because we cant use "this" before super()
|
|
104
|
+
setTimeout(() => {
|
|
105
|
+
this.cancelCb = cb;
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
const oExecutor = (resolve, reject) => {
|
|
109
|
+
executor(resolve, reject, onCancel);
|
|
110
|
+
};
|
|
111
|
+
super(oExecutor);
|
|
112
|
+
}
|
|
113
|
+
cancel() {
|
|
114
|
+
if (this.cancelCb) {
|
|
115
|
+
this.cancelCb();
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
console.warn("onCancel not provided");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.ResponsePromise = ResponsePromise;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface GuidValue {
|
|
2
|
+
toString: () => string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Class to create a guid
|
|
6
|
+
*/
|
|
7
|
+
export declare class Guid implements GuidValue {
|
|
8
|
+
private static _empty;
|
|
9
|
+
static newGuid(): GuidValue;
|
|
10
|
+
static get empty(): GuidValue;
|
|
11
|
+
static isValid(guid: string | GuidValue): boolean;
|
|
12
|
+
private value;
|
|
13
|
+
constructor(guid: string);
|
|
14
|
+
toString(): string;
|
|
15
|
+
toJSON: () => string;
|
|
16
|
+
valueOf(): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//export interface GuidValue {
|
|
3
|
+
// :string;
|
|
4
|
+
//}
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Guid = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Class to create a guid
|
|
9
|
+
*/
|
|
10
|
+
class Guid {
|
|
11
|
+
static newGuid() {
|
|
12
|
+
return new Guid("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, c => {
|
|
13
|
+
const r = Math.random() * 16 | 0;
|
|
14
|
+
const v = (c == "x") ? r : (r & 0x3 | 0x8);
|
|
15
|
+
return v.toString(16);
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
static get empty() {
|
|
19
|
+
return this._empty;
|
|
20
|
+
}
|
|
21
|
+
static isValid(guid) {
|
|
22
|
+
if (guid === undefined || guid === null) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const validRegex = /^[{]?[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}[}]?$/;
|
|
26
|
+
return validRegex.test(guid.toString());
|
|
27
|
+
}
|
|
28
|
+
constructor(guid) {
|
|
29
|
+
this.value = Guid._empty;
|
|
30
|
+
//We serialize as string value
|
|
31
|
+
this.toJSON = () => {
|
|
32
|
+
return this.value.toLowerCase();
|
|
33
|
+
};
|
|
34
|
+
if (guid) {
|
|
35
|
+
if (Guid.isValid(guid)) {
|
|
36
|
+
this.value = guid;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
throw `The string '${guid}' is not a valid Guid`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
toString() {
|
|
44
|
+
return this.value.toLowerCase();
|
|
45
|
+
}
|
|
46
|
+
valueOf() {
|
|
47
|
+
return this.value.toLowerCase();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.Guid = Guid;
|
|
51
|
+
Guid._empty = "00000000-0000-0000-0000-000000000000";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OmniaToken } from ".";
|
|
2
|
+
import { Guid, GuidValue } from "./Guid";
|
|
3
|
+
import { TenantIdentifier } from "./Tenant";
|
|
4
|
+
export interface OmniaSharedBootstrapData {
|
|
5
|
+
uiThreadId: GuidValue;
|
|
6
|
+
workerThreadId: GuidValue;
|
|
7
|
+
customDomain?: string;
|
|
8
|
+
defaultDomain: string;
|
|
9
|
+
routePrefixes: string[];
|
|
10
|
+
language: string;
|
|
11
|
+
/**
|
|
12
|
+
* The tokenKey is only avilable if we are running ITP or Dev intent
|
|
13
|
+
*/
|
|
14
|
+
tokenKey?: OmniaToken;
|
|
15
|
+
tokenRef: GuidValue;
|
|
16
|
+
licenses: Array<Guid>;
|
|
17
|
+
hubDev?: boolean;
|
|
18
|
+
realtimeDevPort?: string;
|
|
19
|
+
tenant: TenantIdentifier;
|
|
20
|
+
servingMode?: boolean;
|
|
21
|
+
serviceDnsMapping: OmniaServiceToDnsMapping;
|
|
22
|
+
}
|
|
23
|
+
export interface OmniaServiceToDnsMapping {
|
|
24
|
+
[serviceId: string]: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Guid, GuidValue } from "./Guid";
|
|
2
|
+
export declare abstract class RealtimeChannel {
|
|
3
|
+
/**
|
|
4
|
+
* Construct a unique channel id that can be targeted to users who are set to be in that channel on the client
|
|
5
|
+
* @returns id
|
|
6
|
+
*/
|
|
7
|
+
abstract getId(): string;
|
|
8
|
+
}
|
|
9
|
+
export declare class BusinuessProfileChannel extends RealtimeChannel {
|
|
10
|
+
private _profileId;
|
|
11
|
+
constructor(profileId: Guid);
|
|
12
|
+
getId(): string;
|
|
13
|
+
}
|
|
14
|
+
export declare abstract class RealtimeData<TRealtimeChannel extends RealtimeChannel, TRealtimeData> {
|
|
15
|
+
private _channel;
|
|
16
|
+
private _value;
|
|
17
|
+
get channel(): TRealtimeChannel;
|
|
18
|
+
get value(): TRealtimeData;
|
|
19
|
+
abstract getId(): GuidValue;
|
|
20
|
+
constructor(channel: TRealtimeChannel, value?: TRealtimeData);
|
|
21
|
+
}
|
|
22
|
+
export declare class PageChatRealtimeData extends RealtimeData<BusinuessProfileChannel, {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
}> {
|
|
26
|
+
constructor(channel: BusinuessProfileChannel);
|
|
27
|
+
getId(): GuidValue;
|
|
28
|
+
}
|
|
29
|
+
export type RealtimeChannelUpdateTypes = "activate" | "deactivate";
|
|
30
|
+
export interface RealtimeChannelUpdateMessage extends RealtimChannelMessage {
|
|
31
|
+
threadId: GuidValue;
|
|
32
|
+
type: RealtimeChannelUpdateTypes;
|
|
33
|
+
}
|
|
34
|
+
export interface RealtimeSendMessage extends RealtimChannelMessage {
|
|
35
|
+
dataId: GuidValue;
|
|
36
|
+
data: any;
|
|
37
|
+
}
|
|
38
|
+
export interface RealtimChannelMessage {
|
|
39
|
+
channelId: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageChatRealtimeData = exports.RealtimeData = exports.BusinuessProfileChannel = exports.RealtimeChannel = void 0;
|
|
4
|
+
const Guid_1 = require("./Guid");
|
|
5
|
+
class RealtimeChannel {
|
|
6
|
+
}
|
|
7
|
+
exports.RealtimeChannel = RealtimeChannel;
|
|
8
|
+
class BusinuessProfileChannel extends RealtimeChannel {
|
|
9
|
+
constructor(profileId) {
|
|
10
|
+
super();
|
|
11
|
+
this._profileId = profileId;
|
|
12
|
+
}
|
|
13
|
+
getId() {
|
|
14
|
+
return this._profileId.toString();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.BusinuessProfileChannel = BusinuessProfileChannel;
|
|
18
|
+
class RealtimeData {
|
|
19
|
+
get channel() {
|
|
20
|
+
return this._channel;
|
|
21
|
+
}
|
|
22
|
+
get value() {
|
|
23
|
+
return this._value;
|
|
24
|
+
}
|
|
25
|
+
constructor(channel, value) {
|
|
26
|
+
this._channel = channel;
|
|
27
|
+
this._value = value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.RealtimeData = RealtimeData;
|
|
31
|
+
//FIXME: This is a test implementation remove when tested
|
|
32
|
+
class PageChatRealtimeData extends RealtimeData {
|
|
33
|
+
constructor(channel) {
|
|
34
|
+
super(channel);
|
|
35
|
+
}
|
|
36
|
+
getId() {
|
|
37
|
+
return new Guid_1.Guid("0366c62b-da25-4ed1-b5dc-de7e9934249f");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.PageChatRealtimeData = PageChatRealtimeData;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedConstants = void 0;
|
|
4
|
+
//TODO: Consider moving Constants from fx models here and merge them
|
|
5
|
+
exports.SharedConstants = {
|
|
6
|
+
broadcast: {
|
|
7
|
+
channelName: "omnia-fx-broadcast"
|
|
8
|
+
},
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GuidValue } from "./Guid";
|
|
2
|
+
export interface OmniaToken {
|
|
3
|
+
tokenKey: string;
|
|
4
|
+
tokenRef: GuidValue;
|
|
5
|
+
loginName: string;
|
|
6
|
+
expires: number;
|
|
7
|
+
forDevIntent: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface OmniaTokenRefWithTenant {
|
|
10
|
+
tenantId: GuidValue;
|
|
11
|
+
tokenRef: GuidValue;
|
|
12
|
+
localDev: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkerProxyFuncs = void 0;
|
|
4
|
+
const Guid_1 = require("./Guid");
|
|
5
|
+
exports.WorkerProxyFuncs = {
|
|
6
|
+
//Worker to Ui functions
|
|
7
|
+
ui: {
|
|
8
|
+
loadManifests: {
|
|
9
|
+
id: new Guid_1.Guid("8fb843b7-936f-4fec-a462-77c087adb7de")
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
//Ui to worker functions
|
|
13
|
+
worker: {}
|
|
14
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GuidValue } from "./Guid";
|
|
2
|
+
import { OmniaSharedBootstrapData } from "./OmniaSharedBootstrapData";
|
|
3
|
+
export interface WorkerProxyAction<TParamType> {
|
|
4
|
+
id: GuidValue;
|
|
5
|
+
}
|
|
6
|
+
export interface WorkerProxyFunction<TParamType, TReturnType> extends WorkerProxyAction<TParamType> {
|
|
7
|
+
}
|
|
8
|
+
export interface WorkerProxyMessage<T> {
|
|
9
|
+
id: GuidValue;
|
|
10
|
+
data: T;
|
|
11
|
+
handlerId: GuidValue;
|
|
12
|
+
initiator: WorkerProxyFunctionInitiators;
|
|
13
|
+
}
|
|
14
|
+
export declare enum WorkerProxyFunctionInitiators {
|
|
15
|
+
ui = "main",
|
|
16
|
+
worker = "worker"
|
|
17
|
+
}
|
|
18
|
+
export interface LoadManifestsMessage extends PostMessageWithType {
|
|
19
|
+
type: "loadManifests";
|
|
20
|
+
resourceUrls: Array<string>;
|
|
21
|
+
}
|
|
22
|
+
export interface BootWorkerMessage {
|
|
23
|
+
type: "bootWorker";
|
|
24
|
+
loadManifests: LoadManifestsMessage;
|
|
25
|
+
bootData: OmniaSharedBootstrapData;
|
|
26
|
+
}
|
|
27
|
+
export interface PostMessageWithType {
|
|
28
|
+
type: "bootWorker" | "loadManifests";
|
|
29
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkerProxyFunctionInitiators = void 0;
|
|
4
|
+
var WorkerProxyFunctionInitiators;
|
|
5
|
+
(function (WorkerProxyFunctionInitiators) {
|
|
6
|
+
WorkerProxyFunctionInitiators["ui"] = "main";
|
|
7
|
+
WorkerProxyFunctionInitiators["worker"] = "worker";
|
|
8
|
+
})(WorkerProxyFunctionInitiators = exports.WorkerProxyFunctionInitiators || (exports.WorkerProxyFunctionInitiators = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./Guid";
|
|
2
|
+
export * from "./Broadcasting";
|
|
3
|
+
export * from "./Topic";
|
|
4
|
+
export * from "./Workers";
|
|
5
|
+
export * from "./SharedConstants";
|
|
6
|
+
export * from "./WorkerProxyFuncs";
|
|
7
|
+
export * from "./Bring";
|
|
8
|
+
export * from "./Future";
|
|
9
|
+
export * from "./Tokens";
|
|
10
|
+
export * from "./Tenant";
|
|
11
|
+
export * from "./Realtime";
|
|
12
|
+
export * from "./OmniaSharedBootstrapData";
|
|
13
|
+
export * from "./StringExtensions";
|
|
14
|
+
export * from "./theming";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//! <omnia-transform-resource path="9a75501c-254b-46d1-9010-7b13681e06f4" />
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./Guid"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./Broadcasting"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./Topic"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./Workers"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./SharedConstants"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./WorkerProxyFuncs"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./Bring"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./Future"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./Tokens"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./Tenant"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./Realtime"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./OmniaSharedBootstrapData"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./StringExtensions"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./theming"), exports);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Guid } from "../Guid";
|
|
2
|
+
import { TypographyDefinition } from "./TypographyDefinition";
|
|
3
|
+
export interface ColorDefinition {
|
|
4
|
+
dark: boolean;
|
|
5
|
+
color: string;
|
|
6
|
+
colorToned: string;
|
|
7
|
+
colorStyles: ColorStyles;
|
|
8
|
+
colorTonedStyles: ColorStyles;
|
|
9
|
+
}
|
|
10
|
+
export interface ColorStyles {
|
|
11
|
+
background: object;
|
|
12
|
+
color: object;
|
|
13
|
+
all: object;
|
|
14
|
+
}
|
|
15
|
+
export interface ColorSchema {
|
|
16
|
+
name: string;
|
|
17
|
+
base: ColorDefinition;
|
|
18
|
+
onBase: ColorDefinition;
|
|
19
|
+
container: ColorDefinition;
|
|
20
|
+
onContainer: ColorDefinition;
|
|
21
|
+
}
|
|
22
|
+
export interface ColorGroup {
|
|
23
|
+
dark: ColorSchema;
|
|
24
|
+
light: ColorSchema;
|
|
25
|
+
}
|
|
26
|
+
export interface ThemeDefinitionV2 {
|
|
27
|
+
id: Guid;
|
|
28
|
+
dark: boolean;
|
|
29
|
+
primary: ColorSchema;
|
|
30
|
+
secondary: ColorSchema;
|
|
31
|
+
accent1: ColorSchema;
|
|
32
|
+
accent2: ColorSchema;
|
|
33
|
+
accent3: ColorSchema;
|
|
34
|
+
neutral: ColorSchema;
|
|
35
|
+
background: ColorSchema;
|
|
36
|
+
error: ColorSchema;
|
|
37
|
+
info: ColorSchema;
|
|
38
|
+
typography: TypographyDefinition;
|
|
39
|
+
}
|
|
40
|
+
export declare const ColorSchemaTypes: {
|
|
41
|
+
primary: string;
|
|
42
|
+
secondary: string;
|
|
43
|
+
accent1: string;
|
|
44
|
+
accent2: string;
|
|
45
|
+
accent3: string;
|
|
46
|
+
neutral: string;
|
|
47
|
+
background: string;
|
|
48
|
+
error: string;
|
|
49
|
+
info: string;
|
|
50
|
+
};
|
|
51
|
+
export declare const ColorTypes: {
|
|
52
|
+
base: string;
|
|
53
|
+
baseTone: string;
|
|
54
|
+
onBase: string;
|
|
55
|
+
onBaseTone: string;
|
|
56
|
+
container: string;
|
|
57
|
+
containerTone: string;
|
|
58
|
+
onContainer: string;
|
|
59
|
+
onContainerTone: string;
|
|
60
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColorTypes = exports.ColorSchemaTypes = void 0;
|
|
4
|
+
exports.ColorSchemaTypes = {
|
|
5
|
+
primary: "primary",
|
|
6
|
+
secondary: "secondary",
|
|
7
|
+
accent1: "accent1",
|
|
8
|
+
accent2: "accent2",
|
|
9
|
+
accent3: "accent3",
|
|
10
|
+
neutral: "neutral",
|
|
11
|
+
background: "background",
|
|
12
|
+
error: "error",
|
|
13
|
+
info: "info",
|
|
14
|
+
};
|
|
15
|
+
exports.ColorTypes = {
|
|
16
|
+
base: "base",
|
|
17
|
+
baseTone: "baseTone",
|
|
18
|
+
onBase: "onBase",
|
|
19
|
+
onBaseTone: "onBaseTone",
|
|
20
|
+
container: "container",
|
|
21
|
+
containerTone: "containerTone",
|
|
22
|
+
onContainer: "onContainer",
|
|
23
|
+
onContainerTone: "onContainerTone",
|
|
24
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Guid } from "../Guid";
|
|
2
|
+
export interface TypographyDefinition {
|
|
3
|
+
id: Guid;
|
|
4
|
+
h1: TypographyType;
|
|
5
|
+
h2: TypographyType;
|
|
6
|
+
h3: TypographyType;
|
|
7
|
+
text: TypographyType;
|
|
8
|
+
caption: TypographyType;
|
|
9
|
+
link: TypographyType;
|
|
10
|
+
}
|
|
11
|
+
export interface TypographyType {
|
|
12
|
+
decoration?: string;
|
|
13
|
+
large: TypographyTypeBreakPoint;
|
|
14
|
+
medium?: TypographyTypeBreakPoint;
|
|
15
|
+
small?: TypographyTypeBreakPoint;
|
|
16
|
+
}
|
|
17
|
+
export interface TypographyTypeBreakPoint {
|
|
18
|
+
weight: number;
|
|
19
|
+
size: number;
|
|
20
|
+
lineHeight: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const TypographyTypes: {
|
|
23
|
+
h1: string;
|
|
24
|
+
h2: string;
|
|
25
|
+
h3: string;
|
|
26
|
+
text: string;
|
|
27
|
+
caption: string;
|
|
28
|
+
link: string;
|
|
29
|
+
};
|
package/models/Enums.d.ts
CHANGED
|
@@ -38,8 +38,10 @@ export declare enum VelcronDescriptorTypes {
|
|
|
38
38
|
}
|
|
39
39
|
export declare enum VelcronComponentPropertyEditors {
|
|
40
40
|
text = 0,
|
|
41
|
-
|
|
42
|
-
slider = 2
|
|
41
|
+
colorSchemaPicker = 1,
|
|
42
|
+
slider = 2,
|
|
43
|
+
colorPicker = 3,
|
|
44
|
+
typographyPicker = 4
|
|
43
45
|
}
|
|
44
46
|
export declare enum VelcronDataTypes {
|
|
45
47
|
unknown = "unknown",
|
package/models/Enums.js
CHANGED
|
@@ -49,8 +49,10 @@ var VelcronDescriptorTypes;
|
|
|
49
49
|
var VelcronComponentPropertyEditors;
|
|
50
50
|
(function (VelcronComponentPropertyEditors) {
|
|
51
51
|
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["text"] = 0] = "text";
|
|
52
|
-
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["
|
|
52
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["colorSchemaPicker"] = 1] = "colorSchemaPicker";
|
|
53
53
|
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["slider"] = 2] = "slider";
|
|
54
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["colorPicker"] = 3] = "colorPicker";
|
|
55
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["typographyPicker"] = 4] = "typographyPicker";
|
|
54
56
|
})(VelcronComponentPropertyEditors = exports.VelcronComponentPropertyEditors || (exports.VelcronComponentPropertyEditors = {}));
|
|
55
57
|
var VelcronDataTypes;
|
|
56
58
|
(function (VelcronDataTypes) {
|
|
@@ -23,7 +23,7 @@ export interface BuiltInComponentRenderers {
|
|
|
23
23
|
}
|
|
24
24
|
export type DynamicViewModel = object;
|
|
25
25
|
export interface OnItemRenderedHookResult {
|
|
26
|
-
cssClass
|
|
26
|
+
cssClass: string;
|
|
27
27
|
containerRenderer?: VelcronContainerRenderer;
|
|
28
28
|
}
|
|
29
29
|
export interface VelcronRenderContext {
|
|
@@ -155,7 +155,7 @@ export interface VelcronTextDefinition extends VelcronDefinition {
|
|
|
155
155
|
type: "Text";
|
|
156
156
|
text: string;
|
|
157
157
|
color?: string;
|
|
158
|
-
|
|
158
|
+
typography?: string;
|
|
159
159
|
events?: VelcronOnPressEvent;
|
|
160
160
|
}
|
|
161
161
|
export interface VelcronImageDefinition extends VelcronDefinition {
|
|
@@ -166,6 +166,7 @@ export interface VelcronImageDefinition extends VelcronDefinition {
|
|
|
166
166
|
export interface VelcronButtonDefinition extends VelcronDefinition {
|
|
167
167
|
type: "Button";
|
|
168
168
|
text: string;
|
|
169
|
+
color: string;
|
|
169
170
|
icon?: VelcronIcon;
|
|
170
171
|
disabled?: boolean;
|
|
171
172
|
events?: VelcronOnPressEvent;
|
|
@@ -206,6 +207,7 @@ export interface VelcronFlexViewDefinition extends VelcronDefinition {
|
|
|
206
207
|
horizontalAlignment?: VelcronHorizontalAlignments;
|
|
207
208
|
verticalAlignment?: VerticalAlignments;
|
|
208
209
|
grow?: number;
|
|
210
|
+
colorSchema?: string;
|
|
209
211
|
width?: "auto" | "stretch" | number | string;
|
|
210
212
|
}
|
|
211
213
|
export interface VelcronSectionColumnWidth {
|
package/package.json
CHANGED
package/parser/VelcronData.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class VelcronData {
|
|
|
28
28
|
static getOrSetObjectByPathUsingRenderContext<T>(renderContext: VelcronRenderContext, path: string, value?: any): T;
|
|
29
29
|
static getTokens(template: any): string[];
|
|
30
30
|
static ensureEventId(event: string): string;
|
|
31
|
-
static ensureKeys(ui: VelcronDefinition | VelcronAppDefinition): void;
|
|
31
|
+
static ensureKeys(ui: VelcronDefinition | VelcronAppDefinition, generateNewKeys?: boolean): void;
|
|
32
32
|
static removeKeys(ui: VelcronDefinition | VelcronAppDefinition): void;
|
|
33
33
|
static generateId(): string;
|
|
34
34
|
static createDeferredPromise<T>(): DeferredPromise<T>;
|
package/parser/VelcronData.js
CHANGED
|
@@ -556,8 +556,8 @@ class VelcronData {
|
|
|
556
556
|
event :
|
|
557
557
|
VelcronConstants_1.VelcronConstants.events.idTokenStart + VelcronData.generateId() + VelcronConstants_1.VelcronConstants.events.idTokenEnd + " " + event;
|
|
558
558
|
}
|
|
559
|
-
static ensureKeys(ui) {
|
|
560
|
-
if (!ui.key) {
|
|
559
|
+
static ensureKeys(ui, generateNewKeys = false) {
|
|
560
|
+
if (!ui.key || generateNewKeys) {
|
|
561
561
|
ui.key = VelcronData.generateId();
|
|
562
562
|
}
|
|
563
563
|
if (ui.events) {
|
|
@@ -572,10 +572,10 @@ class VelcronData {
|
|
|
572
572
|
Object.keys(ui).forEach((key) => {
|
|
573
573
|
if (Array.isArray(ui[key])) {
|
|
574
574
|
ui[key].forEach((item) => {
|
|
575
|
-
if (!item.key) {
|
|
575
|
+
if (!item.key || generateNewKeys) {
|
|
576
576
|
item.key = VelcronData.generateId();
|
|
577
577
|
}
|
|
578
|
-
VelcronData.ensureKeys(item);
|
|
578
|
+
VelcronData.ensureKeys(item, generateNewKeys);
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
581
|
});
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { VelcronDefinition, VelcronRenderContext } from "../models";
|
|
2
|
+
export declare enum VelcronSizeUnits {
|
|
3
|
+
Pixels = 1,
|
|
4
|
+
Numbers = 2
|
|
5
|
+
}
|
|
6
|
+
export interface VelcronStyleSettings {
|
|
7
|
+
sizeUnit: VelcronSizeUnits;
|
|
8
|
+
}
|
|
2
9
|
export declare class VelcronStyles {
|
|
10
|
+
private static styleSettings;
|
|
3
11
|
static create(definition: VelcronDefinition, renderCtx: VelcronRenderContext): any;
|
|
4
12
|
private static createStylesForText;
|
|
5
13
|
private static createStylesForImage;
|
|
6
14
|
private static createStylesForFlexbox;
|
|
7
15
|
private static createStylesForLayoutColumnComponent;
|
|
8
16
|
private static dataBindStyles;
|
|
17
|
+
private static setUnitForValue;
|
|
18
|
+
private static setup;
|
|
9
19
|
}
|
package/parser/VelcronStyles.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VelcronStyles = void 0;
|
|
3
|
+
exports.VelcronStyles = exports.VelcronSizeUnits = void 0;
|
|
4
4
|
const VelcronData_1 = require("./VelcronData");
|
|
5
5
|
const models_1 = require("../models");
|
|
6
6
|
const VelcronConstants_1 = require("./VelcronConstants");
|
|
7
|
+
var VelcronSizeUnits;
|
|
8
|
+
(function (VelcronSizeUnits) {
|
|
9
|
+
VelcronSizeUnits[VelcronSizeUnits["Pixels"] = 1] = "Pixels";
|
|
10
|
+
VelcronSizeUnits[VelcronSizeUnits["Numbers"] = 2] = "Numbers";
|
|
11
|
+
})(VelcronSizeUnits = exports.VelcronSizeUnits || (exports.VelcronSizeUnits = {}));
|
|
7
12
|
class VelcronStyles {
|
|
8
13
|
static create(definition, renderCtx) {
|
|
9
14
|
let result = { ...definition.style };
|
|
@@ -26,20 +31,25 @@ class VelcronStyles {
|
|
|
26
31
|
return result;
|
|
27
32
|
}
|
|
28
33
|
static createStylesForText(textDefinition, styles) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
// const themeStore = useInject(ThemeStore);
|
|
35
|
+
// if (textDefinition.color && textDefinition.color != "") {
|
|
36
|
+
// styles["color"] = themeStore.getters.getColor(textDefinition.color);
|
|
37
|
+
// }
|
|
38
|
+
// else {
|
|
39
|
+
// styles["color"] = themeStore.getters.activeSchema().onBase.color;
|
|
40
|
+
// }
|
|
41
|
+
// const typography = themeStore.getters.typography(textDefinition.typography);
|
|
42
|
+
// styles["fontSize"] = this.setUnitForValue(typography.large.size);
|
|
43
|
+
// styles["font-weight"] = typography.large.weight;
|
|
44
|
+
// styles["line-height"] = this.setUnitForValue(typography.large.lineHeight);
|
|
35
45
|
return styles;
|
|
36
46
|
}
|
|
37
47
|
static createStylesForImage(imageDef, styles) {
|
|
38
48
|
if (!styles.width) {
|
|
39
|
-
styles.width = 200;
|
|
49
|
+
styles.width = this.setUnitForValue(200);
|
|
40
50
|
}
|
|
41
51
|
if (!styles.height) {
|
|
42
|
-
styles.height = 400;
|
|
52
|
+
styles.height = this.setUnitForValue(400);
|
|
43
53
|
}
|
|
44
54
|
styles.flex = "0 0 auto!important";
|
|
45
55
|
return styles;
|
|
@@ -50,44 +60,51 @@ class VelcronStyles {
|
|
|
50
60
|
// styles["flex-direction"] = sectionDef.column ? "column" : "row";
|
|
51
61
|
// return styles;
|
|
52
62
|
// }
|
|
53
|
-
static createStylesForFlexbox(
|
|
54
|
-
const flexGrow =
|
|
63
|
+
static createStylesForFlexbox(flexViewDefinition, styles) {
|
|
64
|
+
const flexGrow = flexViewDefinition.grow ? flexViewDefinition.grow : 1;
|
|
55
65
|
const flextShrink = flexGrow;
|
|
56
66
|
styles.display = "flex";
|
|
57
|
-
styles.flex =
|
|
67
|
+
styles.flex = flexGrow;
|
|
58
68
|
styles["max-width"] = "100%";
|
|
59
|
-
styles["flex-direction"] =
|
|
69
|
+
styles["flex-direction"] = flexViewDefinition.column ? "column" : "row";
|
|
60
70
|
//Auto
|
|
61
|
-
if (
|
|
71
|
+
if (flexViewDefinition.width && flexViewDefinition.width === models_1.VelcronSectionColumnWidthTypes.auto) {
|
|
62
72
|
styles["flex"] = `${flexGrow} ${flextShrink} auto`;
|
|
63
73
|
}
|
|
64
74
|
//Pixels
|
|
65
|
-
else if (
|
|
75
|
+
else if (flexViewDefinition.width && VelcronData_1.VelcronData.isString(flexViewDefinition.width) && flexViewDefinition.width.endsWith("px")) {
|
|
66
76
|
//width["flex"] = `${flexGrow} ${flextShrink} ${columnDef.width}`;
|
|
67
|
-
styles["max-width"] =
|
|
77
|
+
styles["max-width"] = this.setUnitForValue(flexViewDefinition.width);
|
|
68
78
|
}
|
|
69
79
|
//Percentage
|
|
70
|
-
else if (
|
|
71
|
-
styles["flex"] = `${flexGrow} ${flextShrink} ${
|
|
80
|
+
else if (flexViewDefinition.width && (isNaN(flexViewDefinition.width) === false)) {
|
|
81
|
+
styles["flex"] = `${flexGrow} ${flextShrink} ${flexViewDefinition.width}%`;
|
|
72
82
|
}
|
|
73
83
|
// if (columnDef.horizontalAlignment && columnDef.horizontalAlignment !== VelcronHorizontalAlignments.left) {
|
|
74
84
|
// //Need to add this to make horizontalAlignment work for child div
|
|
75
85
|
// result["flex-direction"] = "column";
|
|
76
86
|
// }
|
|
77
|
-
if (
|
|
87
|
+
if (flexViewDefinition.horizontalAlignment) {
|
|
78
88
|
//Need to add this to make horizontalAlignment work for child div
|
|
79
|
-
styles["justify-content"] =
|
|
89
|
+
styles["justify-content"] = flexViewDefinition.horizontalAlignment;
|
|
80
90
|
}
|
|
81
|
-
if (
|
|
82
|
-
if (
|
|
91
|
+
if (flexViewDefinition.verticalAlignment) {
|
|
92
|
+
if (flexViewDefinition.verticalAlignment === models_1.VerticalAlignments.center) {
|
|
83
93
|
//result["flex-direction"] = "column";
|
|
84
94
|
styles["align-items"] = "center";
|
|
85
95
|
}
|
|
86
|
-
else if (
|
|
96
|
+
else if (flexViewDefinition.verticalAlignment === models_1.VerticalAlignments.bottom) {
|
|
87
97
|
//result["flex-direction"] = "column";
|
|
88
98
|
styles["align-items"] = "flex-end";
|
|
89
99
|
}
|
|
90
100
|
}
|
|
101
|
+
// if (flexViewDefinition.colorSchema && flexViewDefinition.colorSchema != "") {
|
|
102
|
+
// const themeStore = useInject(ThemeStore);
|
|
103
|
+
// styles["background-color"] = themeStore.getters.activeSchema().base.color;
|
|
104
|
+
// }
|
|
105
|
+
//Color
|
|
106
|
+
//if(flexViewDefinition.co)
|
|
107
|
+
//const { theming } = useTheme();
|
|
91
108
|
return styles;
|
|
92
109
|
}
|
|
93
110
|
static createStylesForLayoutColumnComponent(layoutDef, columnDef, styles) {
|
|
@@ -111,5 +128,17 @@ class VelcronStyles {
|
|
|
111
128
|
});
|
|
112
129
|
return styles;
|
|
113
130
|
}
|
|
131
|
+
static setUnitForValue(value) {
|
|
132
|
+
if (this.styleSettings.sizeUnit === VelcronSizeUnits.Pixels) {
|
|
133
|
+
return value + "px";
|
|
134
|
+
}
|
|
135
|
+
return value;
|
|
136
|
+
}
|
|
137
|
+
static setup(settings) {
|
|
138
|
+
this.styleSettings = settings;
|
|
139
|
+
}
|
|
114
140
|
}
|
|
115
141
|
exports.VelcronStyles = VelcronStyles;
|
|
142
|
+
VelcronStyles.styleSettings = {
|
|
143
|
+
sizeUnit: VelcronSizeUnits.Pixels
|
|
144
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class VelcronStore {
|
|
2
|
+
static makeReactive: (obj: any) => unknown;
|
|
3
|
+
static reactivityCreator(fn: (obj: any) => unknown): void;
|
|
4
|
+
state<T>(obj: T): T;
|
|
5
|
+
mutation(fn: () => void): void;
|
|
6
|
+
}
|
|
7
|
+
export declare class TestStore extends VelcronStore {
|
|
8
|
+
test: {
|
|
9
|
+
title: string;
|
|
10
|
+
};
|
|
11
|
+
increment: (text: string) => string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestStore = exports.VelcronStore = void 0;
|
|
4
|
+
class VelcronStore {
|
|
5
|
+
static reactivityCreator(fn) {
|
|
6
|
+
VelcronStore.makeReactive = fn;
|
|
7
|
+
}
|
|
8
|
+
state(obj) {
|
|
9
|
+
if (!VelcronStore.makeReactive) {
|
|
10
|
+
throw new Error("Reactivity creator not set");
|
|
11
|
+
}
|
|
12
|
+
return VelcronStore.makeReactive(obj);
|
|
13
|
+
}
|
|
14
|
+
mutation(fn) {
|
|
15
|
+
fn();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.VelcronStore = VelcronStore;
|
|
19
|
+
class TestStore extends VelcronStore {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.test = this.state({ title: "Hello" });
|
|
23
|
+
this.increment = (text) => this.test.title = text;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.TestStore = TestStore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./VelcronStore";
|
package/stores/index.js
ADDED