@contrail/documents 1.2.7 → 1.2.9-alpha.0
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.
|
@@ -12,4 +12,5 @@ export declare class DocumentElementPropertyBindingHandler {
|
|
|
12
12
|
static bindPropertiesToElement(element: DocumentElement, model: DocumentElementModel): void;
|
|
13
13
|
static isContentTypeWebViewable(contentType: string): boolean;
|
|
14
14
|
static adjustPropertyElements(element: DocumentElement, elements: DocumentElement[], model: any): void;
|
|
15
|
+
static clearOrSetColorBindingsOnStyleChange(element: DocumentElement, changes: DocumentElement): void;
|
|
15
16
|
}
|
|
@@ -106,5 +106,22 @@ class DocumentElementPropertyBindingHandler {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
static clearOrSetColorBindingsOnStyleChange(element, changes) {
|
|
110
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
111
|
+
if (((_a = changes === null || changes === void 0 ? void 0 : changes.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) && ((_b = element === null || element === void 0 ? void 0 : element.propertyBindings) === null || _b === void 0 ? void 0 : _b['style.backgroundColor'])) {
|
|
112
|
+
delete element.propertyBindings['style.backgroundColor'];
|
|
113
|
+
(_c = element.propertyBindings) === null || _c === void 0 ? true : delete _c['style.color'];
|
|
114
|
+
}
|
|
115
|
+
else if (((_d = changes === null || changes === void 0 ? void 0 : changes.style) === null || _d === void 0 ? void 0 : _d.backgroundColor) === '' && ((_e = element === null || element === void 0 ? void 0 : element.propertyBindings) === null || _e === void 0 ? void 0 : _e.text)) {
|
|
116
|
+
element.propertyBindings['style.backgroundColor'] = `${element.propertyBindings.text}.hexCode`;
|
|
117
|
+
element.propertyBindings['style.color'] = `${element.propertyBindings.text}.textColorHexCode`;
|
|
118
|
+
}
|
|
119
|
+
if (((_f = changes === null || changes === void 0 ? void 0 : changes.style) === null || _f === void 0 ? void 0 : _f.color) && ((_g = element === null || element === void 0 ? void 0 : element.propertyBindings) === null || _g === void 0 ? void 0 : _g['style.color'])) {
|
|
120
|
+
delete element.propertyBindings['style.color'];
|
|
121
|
+
}
|
|
122
|
+
else if (((_h = changes === null || changes === void 0 ? void 0 : changes.style) === null || _h === void 0 ? void 0 : _h.color) === '' && ((_j = element === null || element === void 0 ? void 0 : element.propertyBindings) === null || _j === void 0 ? void 0 : _j.text)) {
|
|
123
|
+
element.propertyBindings['style.color'] = `${element.propertyBindings.text}.textColorHexCode`;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
109
126
|
}
|
|
110
127
|
exports.DocumentElementPropertyBindingHandler = DocumentElementPropertyBindingHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrail/documents",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9-alpha.0",
|
|
4
4
|
"description": "Documents library for contrail platform",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"testEnvironment": "node"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@contrail/actions": "^1.0.
|
|
42
|
-
"@contrail/document-table": "^1.0.
|
|
43
|
-
"@contrail/types": "^3.0
|
|
44
|
-
"@contrail/document-util": "^1.0.
|
|
41
|
+
"@contrail/actions": "^1.0.17-alpha.0",
|
|
42
|
+
"@contrail/document-table": "^1.0.5-alpha.0",
|
|
43
|
+
"@contrail/types": "^3.1.2-alpha.0",
|
|
44
|
+
"@contrail/document-util": "^1.0.8-alpha.0",
|
|
45
45
|
"reflect-metadata": "^0.1.13"
|
|
46
46
|
}
|
|
47
47
|
}
|