dbm 1.4.10 → 1.4.13
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/commands/index.js +6 -0
- package/css/all.css +2 -1
- package/css/tags.css +10 -1
- package/css/text.css +4 -0
- package/flow/FlowProperty.js +14 -1
- package/flow/index.js +28 -0
- package/flow/updatefunctions/basic/GetItemBy.js +20 -0
- package/flow/updatefunctions/basic/index.js +12 -0
- package/flow/updatefunctions/dom/WindowSize.js +33 -0
- package/flow/updatefunctions/dom/index.js +2 -1
- package/flow/updatefunctions/logic/Condition.js +6 -6
- package/graphapi/webclient/index.js +12 -0
- package/package.json +1 -1
- package/react/admin/objects/EditObject.js +17 -5
- package/react/form/CustomSelection.js +69 -0
- package/react/form/GraphApiObjectCustomSelection.js +105 -0
- package/react/form/index.js +2 -0
- package/updater/PropertyUpdater.js +4 -0
- package/updater/index.js +10 -6
- package/utils/MathFunctions.js +15 -0
- package/utils/index.js +1 -0
package/commands/index.js
CHANGED
|
@@ -61,6 +61,12 @@ export const performCommands = function(aCommands, aFromObject = null, aEventDat
|
|
|
61
61
|
let currentArrayLength = currentArray.length;
|
|
62
62
|
for(let i = 0; i < currentArrayLength; i++) {
|
|
63
63
|
let currentCommand = currentArray[i];
|
|
64
|
+
|
|
65
|
+
if(currentCommand && currentCommand.isSource) {
|
|
66
|
+
currentCommand = currentCommand.getSource(aFromObject);
|
|
67
|
+
}
|
|
68
|
+
//METODO: add flow property
|
|
69
|
+
|
|
64
70
|
try {
|
|
65
71
|
currentCommand.perform(aFromObject, aEventData);
|
|
66
72
|
}
|
package/css/all.css
CHANGED
package/css/tags.css
CHANGED
|
@@ -107,8 +107,17 @@
|
|
|
107
107
|
overflow: hidden;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
.standard-tag-list .standard-tag-list-item{
|
|
110
|
+
.standard-tag-list .standard-tag-list-item {
|
|
111
111
|
float: left;
|
|
112
112
|
margin-right: var(--standard-tag-list-horizontal-margin, 10px);
|
|
113
113
|
margin-bottom: var(--standard-tag-list-vertical-margin, 5px);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.option {
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.option.selected {
|
|
121
|
+
background-color: var(--standard-tag-option-selected-background-color, #555555);
|
|
122
|
+
color: var(--standard-tag-option-selected-text-color, #ffffff);
|
|
114
123
|
}
|
package/css/text.css
ADDED
package/flow/FlowProperty.js
CHANGED
|
@@ -48,18 +48,31 @@ export default class FlowProperty extends Dbm.flow.FlowBaseObject {
|
|
|
48
48
|
return this;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
addAdditionalAnimation(aFromValue, aToValue, aTime = 0.5, aDelay = 0, aEasing = null) {
|
|
52
52
|
Dbm.getInstance().repository.getItem("propertyUpdater").controller.addPropertyAnimation(this, aFromValue, aToValue, aTime, aDelay, aEasing);
|
|
53
53
|
|
|
54
54
|
return this;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
addAddionalAnimation(aFromValue, aToValue, aTime = 0.5, aDelay = 0, aEasing = null) {
|
|
58
|
+
//METODO: warning message
|
|
59
|
+
this.addAdditionalAnimation(aFromValue, aToValue, aTime, aDelay, aEasing);
|
|
60
|
+
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
delayValue(aToValue, aDelay = 0) {
|
|
58
65
|
Dbm.getInstance().repository.getItem("propertyUpdater").controller.delayUpdateProperty(this, aToValue, aDelay);
|
|
59
66
|
|
|
60
67
|
return this;
|
|
61
68
|
}
|
|
62
69
|
|
|
70
|
+
addDelayValue(aToValue, aDelay = 0) {
|
|
71
|
+
Dbm.getInstance().repository.getItem("propertyUpdater").controller.addDelayUpdateProperty(this, aToValue, aDelay);
|
|
72
|
+
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
|
|
63
76
|
getMostUpstreamProperty() {
|
|
64
77
|
|
|
65
78
|
let debugCounter = 0;
|
package/flow/index.js
CHANGED
|
@@ -92,4 +92,32 @@ export const externalObject = function(aObject) {
|
|
|
92
92
|
returnObject.item.properties.object.setOrConnect(aObject);
|
|
93
93
|
|
|
94
94
|
return returnObject;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const dynamicUpdateFunction = function(aFunction, aInputs = {}, aOutputs = {}) {
|
|
98
|
+
|
|
99
|
+
let inputs = {...aInputs};
|
|
100
|
+
let outputs = {...aOutputs};
|
|
101
|
+
|
|
102
|
+
let TheClass = class DynamicUpdateFunction extends Dbm.flow.FlowUpdateFunction {
|
|
103
|
+
_construct() {
|
|
104
|
+
super._construct();
|
|
105
|
+
|
|
106
|
+
for(let objectName in inputs) {
|
|
107
|
+
this.input.register(objectName, inputs[objectName]);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
for(let objectName in outputs) {
|
|
111
|
+
this.output.register(objectName, outputs[objectName]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
_update() {
|
|
116
|
+
//MENOTE: dynamically replaced
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
TheClass.prototype._update = aFunction;
|
|
121
|
+
|
|
122
|
+
return new TheClass();
|
|
95
123
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Dbm from "../../../index.js";
|
|
2
|
+
|
|
3
|
+
export default class GetItemBy extends Dbm.flow.FlowUpdateFunction {
|
|
4
|
+
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
this.input.register("value", null);
|
|
9
|
+
this.input.register("items", []);
|
|
10
|
+
this.input.register("path", "id");
|
|
11
|
+
|
|
12
|
+
this.output.register("value", null);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
_update() {
|
|
16
|
+
//console.log("GetItemBy::_update");
|
|
17
|
+
|
|
18
|
+
this.output.value = Dbm.utils.ArrayFunctions.getItemBy(this.input.items, this.input.path, this.input.value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -8,6 +8,7 @@ export {default as PropertyOfWithDefault} from "./PropertyOfWithDefault.js";
|
|
|
8
8
|
export {default as MappedList} from "./MappedList.js";
|
|
9
9
|
export {default as Translation} from "./Translation.js";
|
|
10
10
|
export {default as SetProperty} from "./SetProperty.js";
|
|
11
|
+
export {default as GetItemBy} from "./GetItemBy.js";
|
|
11
12
|
|
|
12
13
|
export const runCommand = function(aValue, aCommand) {
|
|
13
14
|
let updateFunction = new Dbm.flow.updatefunctions.basic.RunCommand();
|
|
@@ -134,5 +135,16 @@ export const setProperty = function(aObject, aPropertyName, aValue = null) {
|
|
|
134
135
|
properties.object.setOrConnect(aObject);
|
|
135
136
|
properties.propertyName.setOrConnect(aPropertyName);
|
|
136
137
|
|
|
138
|
+
return updateFunction;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export const getItemBy = function(aItems, aValue, aPath = "id") {
|
|
142
|
+
let updateFunction = new Dbm.flow.updatefunctions.basic.GetItemBy();
|
|
143
|
+
|
|
144
|
+
let properties = updateFunction.input.properties;
|
|
145
|
+
properties.value.setOrConnect(aValue);
|
|
146
|
+
properties.items.setOrConnect(aItems);
|
|
147
|
+
properties.path.setOrConnect(aPath);
|
|
148
|
+
|
|
137
149
|
return updateFunction;
|
|
138
150
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Dbm from "../../../index.js";
|
|
2
|
+
|
|
3
|
+
export default class WindowSize extends Dbm.flow.FlowUpdateFunction {
|
|
4
|
+
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
this.output.register("width", window.innerWidth);
|
|
9
|
+
this.output.register("height", window.innerHeight);
|
|
10
|
+
|
|
11
|
+
this._callback_sizeChangedBound = this._callback_sizeChanged.bind(this);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
start() {
|
|
15
|
+
window.addEventListener("resize", this._callback_sizeChangedBound, false);
|
|
16
|
+
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
_update() {
|
|
21
|
+
//console.log("_update");
|
|
22
|
+
|
|
23
|
+
this.output.width = window.innerWidth;
|
|
24
|
+
this.output.height = window.innerHeight;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_callback_sizeChanged(aEvent) {
|
|
28
|
+
//console.log("_callback_sizeChanged");
|
|
29
|
+
|
|
30
|
+
this.output.properties.width._internal_setValueInFlowOutsideOfUpdate(window.innerWidth);
|
|
31
|
+
this.output.properties.height._internal_setValueInFlowOutsideOfUpdate(window.innerHeight);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -2,4 +2,5 @@ export {default as ElementSize} from "./ElementSize.js";
|
|
|
2
2
|
export {default as StyleObject} from "./StyleObject.js";
|
|
3
3
|
export {default as HorizontalFlip} from "./HorizontalFlip.js";
|
|
4
4
|
export {default as ElementPosition} from "./ElementPosition.js";
|
|
5
|
-
export {default as TransformStyle} from "./TransformStyle.js";
|
|
5
|
+
export {default as TransformStyle} from "./TransformStyle.js";
|
|
6
|
+
export {default as WindowSize} from "./WindowSize.js";
|
|
@@ -17,13 +17,13 @@ export default class Condition extends Dbm.flow.FlowUpdateFunction {
|
|
|
17
17
|
|
|
18
18
|
let operation = this.input.operation;
|
|
19
19
|
if(typeof(operation) === "string") {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//METODO: add more operations
|
|
25
|
-
operation = function(aA, aB) {return aA === aB;}
|
|
20
|
+
let compareFunction = Dbm.getInstance().repository.getItem("compareFunctions/" + operation).compare;
|
|
21
|
+
if(!compareFunction) {
|
|
22
|
+
console.warn("No copmare function registered for: " + operation + ". Using ==", this);
|
|
23
|
+
compareFunction = Dbm.utils.CompareFunctions.equals;
|
|
26
24
|
}
|
|
25
|
+
|
|
26
|
+
operation = compareFunction
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
this.output.result = operation.call(this, this.input.input1, this.input.input2);
|
|
@@ -65,4 +65,16 @@ export const performAction = function(aType, aData, aCallback = null) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
return request.properties.data;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const loadRange = function(aSelects, aEncodings, aCommand) {
|
|
71
|
+
let graphApi = Dbm.getRepositoryItem("cachedGraphApi").controller;
|
|
72
|
+
|
|
73
|
+
let request = graphApi.requestRange(aSelects, aEncodings);
|
|
74
|
+
|
|
75
|
+
if(aCommand) {
|
|
76
|
+
Dbm.flow.runWhenMatched(request.properties.status, Dbm.loading.LoadingStatus.LOADED, aCommand);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return request.properties.items;
|
|
68
80
|
}
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ export default class EditObject extends Dbm.react.BaseObject {
|
|
|
19
19
|
{"type": "includeDraft"},
|
|
20
20
|
{"type": "idSelection", "ids": [id]},
|
|
21
21
|
],
|
|
22
|
-
["objectTypes"]
|
|
22
|
+
["objectTypes", "name", "identifier"]
|
|
23
23
|
);
|
|
24
24
|
allLoaded.addCheck(request.properties.status);
|
|
25
25
|
}
|
|
@@ -38,11 +38,23 @@ export default class EditObject extends Dbm.react.BaseObject {
|
|
|
38
38
|
|
|
39
39
|
React.createElement(Dbm.react.area.HasData, {check: this.item.properties.loaded},
|
|
40
40
|
React.createElement(Dbm.react.context.AddContextVariables, {"values": {"item": item}},
|
|
41
|
-
React.createElement(Dbm.react.admin.editorsgroup.EditItem, {},
|
|
42
|
-
React.createElement(
|
|
43
|
-
Dbm.react.text.text(Dbm.react.source.
|
|
41
|
+
React.createElement(Dbm.react.admin.editorsgroup.EditItem, {},
|
|
42
|
+
React.createElement("h2", {"className": "no-margins"},
|
|
43
|
+
Dbm.react.text.text(Dbm.react.source.item("id")),
|
|
44
|
+
" - ",
|
|
45
|
+
Dbm.react.text.text(Dbm.react.source.item("name")),
|
|
44
46
|
),
|
|
45
|
-
React.createElement(
|
|
47
|
+
React.createElement("div", {"className": "small-description"},
|
|
48
|
+
Dbm.react.text.text(Dbm.react.source.item("identifier"))
|
|
49
|
+
),
|
|
50
|
+
React.createElement("div", {"className": "spacing small"}),
|
|
51
|
+
React.createElement(Dbm.react.area.List, {items: Dbm.react.source.item("objectTypes"), className: "inline-list standard-tag-list standard-tag-list-expand", "as": "objectType", "keyField": "(root)"},
|
|
52
|
+
React.createElement("div", {"className": "standard-tag standard-tag-padding standard-tag-list-item inline-list-item display-inline-block"},
|
|
53
|
+
Dbm.react.text.text(Dbm.react.source.contextVariable("objectType"))
|
|
54
|
+
)
|
|
55
|
+
),
|
|
56
|
+
React.createElement("div", {"className": "spacing small"}),
|
|
57
|
+
React.createElement(Dbm.react.area.List, {items: Dbm.react.source.item("objectTypes"), "as": "objectType", "keyField": "(root)"},
|
|
46
58
|
React.createElement(Dbm.react.admin.objects.InjectObjectTypeEditor, {type: Dbm.react.source.contextVariable("objectType")})
|
|
47
59
|
)
|
|
48
60
|
)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class CustomSelection extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
let valueProperty = this.getDynamicPropWithoutState("value", null);
|
|
9
|
+
let itemsProperty = this.getDynamicPropWithoutState("items", []);
|
|
10
|
+
|
|
11
|
+
let openProperty = this.item.requireProperty("open", false);
|
|
12
|
+
this.item.requireProperty("rows", []);
|
|
13
|
+
|
|
14
|
+
this.item.requireProperty("selectedItem", null);
|
|
15
|
+
|
|
16
|
+
let mappedList = Dbm.flow.updatefunctions.basic.mappedList(itemsProperty, [this._getScopedCallFunctionCommand(this._newRow, [Dbm.core.source.event("mappedItem")])]);
|
|
17
|
+
this.item.setValue("mappedList", mappedList);
|
|
18
|
+
this.item.properties.rows.connectInput(mappedList.output.properties.items);
|
|
19
|
+
|
|
20
|
+
let singleSelection = new Dbm.flow.controllers.select.SingleSelection();
|
|
21
|
+
this.item.setValue("singleSelection", singleSelection.item);
|
|
22
|
+
singleSelection.item.properties.value.connectInput(valueProperty);
|
|
23
|
+
|
|
24
|
+
let closeCommand = Dbm.commands.setProperty(openProperty, false);
|
|
25
|
+
this.item.setValue("closeCommand", closeCommand);
|
|
26
|
+
|
|
27
|
+
let path = this.getPropValueWithDefault("path", "id");
|
|
28
|
+
let getItemBy = Dbm.flow.updatefunctions.basic.getItemBy(itemsProperty, valueProperty, path);
|
|
29
|
+
this.item.setValue("getItemBy", getItemBy);
|
|
30
|
+
|
|
31
|
+
this.item.properties.selectedItem.connectInput(getItemBy.output.properties.value);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_newRow(aRow) {
|
|
35
|
+
//console.log("_newRow");
|
|
36
|
+
//console.log(aRow);
|
|
37
|
+
|
|
38
|
+
let path = this.getPropValueWithDefault("path", "id");
|
|
39
|
+
|
|
40
|
+
let value = Dbm.objectPath(aRow, "forItem." + path);
|
|
41
|
+
|
|
42
|
+
let selectedProperty = this.item.singleSelection.controller.addSelectionValue(value);
|
|
43
|
+
|
|
44
|
+
aRow.setValue("value", value);
|
|
45
|
+
aRow.requireProperty("selected", false).connectInput(selectedProperty);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_renderMainElement() {
|
|
49
|
+
|
|
50
|
+
let children = Dbm.utils.ArrayFunctions.singleOrArray(this.getPropValue("children"));
|
|
51
|
+
|
|
52
|
+
let slots = Dbm.react.ChildFunctions.splitIntoSlots(children);
|
|
53
|
+
|
|
54
|
+
let buttonElement = slots["button"];
|
|
55
|
+
let mainChildren = slots.main;
|
|
56
|
+
|
|
57
|
+
let contextValues = {"value": this.item.properties["props/value"], "selectedItem": this.item.properties.selectedItem, "rows": this.item.properties.rows, "closeCommand": this.item.closeCommand};
|
|
58
|
+
|
|
59
|
+
return this._createMainElement(Dbm.react.form.Dropdown, {"open": this.item.properties.open},
|
|
60
|
+
React.createElement(Dbm.react.context.AddContextVariables, {"data-slot": "button", "values": contextValues},
|
|
61
|
+
React.createElement(Dbm.react.area.InsertElement, {"element": buttonElement})
|
|
62
|
+
),
|
|
63
|
+
React.createElement(Dbm.react.context.AddContextVariables, {"values": contextValues},
|
|
64
|
+
React.createElement(Dbm.react.area.InsertElement, {"element": mainChildren})
|
|
65
|
+
)
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class GraphApiObjectSelection extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
this.getDynamicProp("value", "");
|
|
9
|
+
this.item.requireProperty("items", []);
|
|
10
|
+
this.item.requireProperty("sortedItems", []);
|
|
11
|
+
|
|
12
|
+
let objectType = this.getPropValue("objectType");
|
|
13
|
+
let encodings = Dbm.utils.ArrayFunctions.arrayOrSeparatedString(this.getPropValueWithDefault("encoding", "name"), ",", true);
|
|
14
|
+
|
|
15
|
+
{
|
|
16
|
+
let selects = [
|
|
17
|
+
{"type": "byObjectType", "objectType": objectType},
|
|
18
|
+
{"type": "includeDraft"},
|
|
19
|
+
{"type": "includePrivate"}
|
|
20
|
+
];
|
|
21
|
+
if(this.getPropValue("anyStatus")) {
|
|
22
|
+
selects = [
|
|
23
|
+
{"type": "byObjectType", "objectType": objectType},
|
|
24
|
+
{"type": "includeAnyStatus"}
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let request = Dbm.getCachedGraphApi().requestRange(
|
|
29
|
+
selects,
|
|
30
|
+
encodings
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
this.item.properties.items.connectInput(request.properties.items);
|
|
34
|
+
|
|
35
|
+
Dbm.flow.runWhenMatched(request.properties.status, Dbm.loading.LoadingStatus.LOADED, Dbm.commands.callFunction(this._itemsLoaded.bind(this), [request]));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
_itemsLoaded(aRequest) {
|
|
40
|
+
|
|
41
|
+
let nameField = this.getPropValueWithDefault("nameField", "name");
|
|
42
|
+
|
|
43
|
+
let currentArray = [].concat(aRequest.items);
|
|
44
|
+
Dbm.utils.ArrayFunctions.naturalSortOnField(currentArray, nameField);
|
|
45
|
+
|
|
46
|
+
this.item.sortedItems = currentArray;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_renderMainElement() {
|
|
50
|
+
|
|
51
|
+
let value = this.getDynamicProp("value");
|
|
52
|
+
let nameField = this.getPropValueWithDefault("nameField", "name");
|
|
53
|
+
|
|
54
|
+
return this._createMainElement(Dbm.react.form.CustomSelection, {"value": value, "items": this.item.properties.sortedItems, "path": nameField},
|
|
55
|
+
|
|
56
|
+
React.createElement("div", {
|
|
57
|
+
"data-slot": "button",
|
|
58
|
+
children: [React.createElement(Dbm.react.area.HasData, {
|
|
59
|
+
check: Dbm.react.source.contextVariable("value"),
|
|
60
|
+
children: React.createElement(Dbm.react.context.AddItemToContext, {
|
|
61
|
+
item: Dbm.react.source.contextVariable("selectedItem"),
|
|
62
|
+
children: [React.createElement(Dbm.react.area.HasData, {
|
|
63
|
+
check: Dbm.react.source.item(),
|
|
64
|
+
children: React.createElement("div", {
|
|
65
|
+
children: Dbm.react.text.text(Dbm.react.source.item("name"))
|
|
66
|
+
})
|
|
67
|
+
}), React.createElement(Dbm.react.area.HasData, {
|
|
68
|
+
check: Dbm.react.source.item(),
|
|
69
|
+
checkType: "invert/default",
|
|
70
|
+
children: React.createElement("div", {
|
|
71
|
+
children: Dbm.react.text.text(Dbm.react.source.contextVariable("value"))
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
})
|
|
75
|
+
}), React.createElement(Dbm.react.area.HasData, {
|
|
76
|
+
check: Dbm.react.source.contextVariable("value"),
|
|
77
|
+
checkType: "invert/default",
|
|
78
|
+
children: React.createElement("div", {
|
|
79
|
+
children: Dbm.react.text.translatedText("Select")
|
|
80
|
+
})
|
|
81
|
+
})]
|
|
82
|
+
}), React.createElement("div", {
|
|
83
|
+
children: React.createElement(Dbm.react.area.HasData, {
|
|
84
|
+
check: Dbm.react.source.contextVariable("isVisible"),
|
|
85
|
+
children: React.createElement(Dbm.react.area.List, {
|
|
86
|
+
items: Dbm.react.source.contextVariable("rows"),
|
|
87
|
+
as: "row",
|
|
88
|
+
children: React.createElement(Dbm.react.context.AddItemToContext, {
|
|
89
|
+
item: Dbm.react.source.contextVariable("row.forItem"),
|
|
90
|
+
children: React.createElement(Dbm.react.interaction.CommandButton, {
|
|
91
|
+
commands: [Dbm.commands.setProperty(Dbm.react.source.contextVariable("row.properties.selected"), true), Dbm.react.source.contextVariable("closeCommand")],
|
|
92
|
+
children: React.createElement("div", {
|
|
93
|
+
children: Dbm.react.text.text(Dbm.react.source.item("name"))
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
package/react/form/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export {default as LabelledArea} from "./LabelledArea.js";
|
|
|
7
7
|
export {default as FileDropArea} from "./FileDropArea.js";
|
|
8
8
|
export {default as Selection} from "./Selection.js";
|
|
9
9
|
export {default as GraphApiObjectSelection} from "./GraphApiObjectSelection.js";
|
|
10
|
+
export {default as GraphApiObjectCustomSelection} from "./GraphApiObjectCustomSelection.js";
|
|
10
11
|
export {default as GraphApiSelectOrCreateObject} from "./GraphApiSelectOrCreateObject.js";
|
|
11
12
|
export {default as GraphApiImage} from "./GraphApiImage.js";
|
|
12
13
|
export {default as EditArray} from "./EditArray.js";
|
|
@@ -16,6 +17,7 @@ export {default as Form} from "./Form.js";
|
|
|
16
17
|
export {default as Option} from "./Option.js";
|
|
17
18
|
export {default as Dropdown} from "./Dropdown.js";
|
|
18
19
|
export {default as GraphApiObjectOptions} from "./GraphApiObjectOptions.js";
|
|
20
|
+
export {default as CustomSelection} from "./CustomSelection.js";
|
|
19
21
|
|
|
20
22
|
export const validationStateClassName = function(aChildren) {
|
|
21
23
|
return React.createElement(Dbm.react.AddProps, {className: Dbm.react.source.contextVariable("field.properties.validationState")},
|
|
@@ -147,6 +147,10 @@ export default class PropertyUpdater extends Dbm.core.BaseObject {
|
|
|
147
147
|
this._currentTweens.get(aProperty).stop();
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
return this.addDelayUpdateProperty(aProperty, aToValue, aDelay);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
addDelayUpdateProperty(aProperty, aToValue, aDelay = 0) {
|
|
150
154
|
let tweenObject = {"envelope": aProperty.value};
|
|
151
155
|
|
|
152
156
|
let tween = new Tween(tweenObject).to({"envelope": aToValue}, 0).delay(1000*aDelay).onUpdate(function(aData) {
|
package/updater/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Easing } from "@tweenjs/tween.js";
|
|
1
2
|
import Dbm from "../index.js";
|
|
2
3
|
|
|
3
4
|
export {default as PropertyUpdater} from "./PropertyUpdater.js";
|
|
4
5
|
export {default as RequestAnimationFrameTimer} from "./RequestAnimationFrameTimer.js";
|
|
5
6
|
export {default as IntervalTimer} from "./IntervalTimer.js";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
export const webSetup = function() {
|
|
8
9
|
let updater = new Dbm.updater.PropertyUpdater();
|
|
9
10
|
updater.item.register("propertyUpdater");
|
|
10
11
|
|
|
@@ -14,9 +15,14 @@ let webSetup = function() {
|
|
|
14
15
|
updater.start();
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
export {
|
|
18
|
+
export const setupEasingFunctions = function() {
|
|
19
|
+
let item = Dbm.getRepositoryItem("easingFunctions");
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
item.setValue("easeOut", Easing.Quadratic.Out);
|
|
22
|
+
item.setValue("easeIn", Easing.Quadratic.In);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const nodeSetup = function() {
|
|
20
26
|
let updater = new Dbm.updater.PropertyUpdater();
|
|
21
27
|
updater.item.register("propertyUpdater");
|
|
22
28
|
|
|
@@ -24,6 +30,4 @@ let nodeSetup = function() {
|
|
|
24
30
|
updater.setTimer(timer.item);
|
|
25
31
|
|
|
26
32
|
updater.start();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export {nodeSetup};
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const clamp = function(aValue, aMinValue = 0, aMaxValue = 1) {
|
|
2
|
+
return Math.max(Math.min(aValue, aMaxValue), aMinValue);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export const parametricValue = function(aValue, aStartValue, aEndValue) {
|
|
6
|
+
return (aValue-aStartValue)/(aEndValue-aStartValue);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const clampedParametricValue = function(aValue, aStartValue, aEndValue) {
|
|
10
|
+
return clamp(parametricValue(aValue, aStartValue, aEndValue), 0, 1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const linearInerpolation = function(aParameter, aStartValue, aEndValue) {
|
|
14
|
+
return (1-aParameter)*aStartValue+aParameter*aEndValue;
|
|
15
|
+
}
|
package/utils/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export * as TranslationFunctions from "./TranslationFunctions.js";
|
|
|
7
7
|
export * as LevenshteinDistance from "./LevenshteinDistance.js";
|
|
8
8
|
export * as ObjectFunctions from "./ObjectFunctions.js";
|
|
9
9
|
export * as LocalCache from "./LocalCache.js";
|
|
10
|
+
export * as MathFunctions from "./MathFunctions.js";
|
|
10
11
|
|
|
11
12
|
export {default as MultidimensionalArrayHolder} from "./MultidimensionalArrayHolder.js";
|
|
12
13
|
export {default as ArrayOperationResult} from "./ArrayOperationResult.js";
|