dbm 1.4.13 → 1.4.14
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.
|
@@ -134,6 +134,7 @@ export default class ItemEditor extends Dbm.core.BaseObject {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
addMultipleIncomingRelationsEditor(aType, aObjectType, aInitialValue, aUpdateEncoding = null) {
|
|
137
|
+
//console.log("addMultipleIncomingRelationsEditor");
|
|
137
138
|
let name = "in_" + aType + "_" + aObjectType;
|
|
138
139
|
return this._addMultipleRelationsEditor(name, aType, aObjectType, aInitialValue, Dbm.graphapi.webclient.admin.SaveFunctions.multipleIncomingRelations, aUpdateEncoding);
|
|
139
140
|
}
|
|
@@ -144,6 +145,7 @@ export default class ItemEditor extends Dbm.core.BaseObject {
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
getAdminMultipleIncomingRelationsEditor(aType, aObjectType) {
|
|
148
|
+
//console.log("getAdminMultipleIncomingRelationsEditor");
|
|
147
149
|
let name = "in_" + aType + "_" + aObjectType;
|
|
148
150
|
let valueEditor = this.item["editor_multipleRelations_" + name];
|
|
149
151
|
if(!valueEditor) {
|
|
@@ -39,7 +39,12 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
|
|
|
39
39
|
let relation = Dbm.getRepositoryItem(currentRelationData["relationId"]);
|
|
40
40
|
if(typeItem.relations.indexOf(relation) === -1) {
|
|
41
41
|
let linkedItem = Dbm.getRepositoryItem(currentRelationData["id"]);
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
relation.setValue("from", linkedItem);
|
|
44
|
+
relation.setValue("to", aItem);
|
|
45
|
+
relation.setValue("startAt", currentRelationData["startAt"]);
|
|
46
|
+
relation.setValue("endAt", currentRelationData["endAt"]);
|
|
47
|
+
|
|
43
48
|
if(this._isRelationValid(currentRelationData["startAt"], currentRelationData["endAt"])) {
|
|
44
49
|
typeItem.addToArray("objects", linkedItem);
|
|
45
50
|
typeItem.addToArray("relations", relation);
|
|
@@ -72,7 +77,12 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
|
|
|
72
77
|
let relation = Dbm.getRepositoryItem(currentRelationData["relationId"]);
|
|
73
78
|
if(typeItem.relations.indexOf(relation) === -1) {
|
|
74
79
|
let linkedItem = Dbm.getRepositoryItem(currentRelationData["id"]);
|
|
75
|
-
|
|
80
|
+
|
|
81
|
+
relation.setValue("from", aItem);
|
|
82
|
+
relation.setValue("to", linkedItem);
|
|
83
|
+
relation.setValue("startAt", currentRelationData["startAt"]);
|
|
84
|
+
relation.setValue("endAt", currentRelationData["endAt"]);
|
|
85
|
+
|
|
76
86
|
if(this._isRelationValid(currentRelationData["startAt"], currentRelationData["endAt"])) {
|
|
77
87
|
typeItem.addToArray("objects", linkedItem);
|
|
78
88
|
typeItem.addToArray("relations", relation);
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Dbm from "../../index.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
export default class GlobalFilters extends Dbm.core.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
this._styleTag = null;
|
|
9
|
+
|
|
10
|
+
let colorFilters = Dbm.getRepositoryItem("globalSvg");
|
|
11
|
+
let filtersProperty = colorFilters.requireProperty("filters", []);
|
|
12
|
+
|
|
13
|
+
filtersProperty.addUpdate(this._getScopedCallFunctionCommand(this._updateStyles));
|
|
14
|
+
this._updateStyles();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
_updateStyles() {
|
|
18
|
+
console.log("_updateStyles");
|
|
19
|
+
|
|
20
|
+
let colorFilters = Dbm.getRepositoryItem("globalSvg");
|
|
21
|
+
console.log(colorFilters.filters.length);
|
|
22
|
+
|
|
23
|
+
if(colorFilters.filters.length) {
|
|
24
|
+
if(!this._styleTag) {
|
|
25
|
+
this._styleTag = document.createElement("style");
|
|
26
|
+
document.head.appendChild(this._styleTag);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let declarations = Dbm.utils.ArrayFunctions.mapField(colorFilters.filters, "classDeclaration");
|
|
30
|
+
this._styleTag.innerHTML = declarations.join("\n");
|
|
31
|
+
console.log(declarations);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
package/react/svg/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
|
3
3
|
|
|
4
4
|
export {default as GlobalFilters} from "./GlobalFilters.js";
|
|
5
5
|
export {default as MatrixFilter} from "./MatrixFilter.js";
|
|
6
|
+
export {default as AddGlobalFilterClasses} from "./AddGlobalFilterClasses.js";
|
|
6
7
|
|
|
7
8
|
export const addGlobalRgbColorFilter = function(aName, aR, aG, aB) {
|
|
8
9
|
|
|
@@ -11,6 +12,7 @@ export const addGlobalRgbColorFilter = function(aName, aR, aG, aB) {
|
|
|
11
12
|
|
|
12
13
|
let item = Dbm.getRepositoryItem("globalSvg/filters/" + aName);
|
|
13
14
|
item.setValue("element", React.createElement(Dbm.react.svg.MatrixFilter, {"id": aName, "matrix": Dbm.utils.svg.ColorMatrixFunctions.floodColor(aR, aG, aB)}));
|
|
15
|
+
item.setValue("classDeclaration", "." + aName + "{filter:url(\"#" + aName + "\")}");
|
|
14
16
|
|
|
15
17
|
let filters = [].concat(colorFilters.filters);
|
|
16
18
|
filters.push(item);
|