dbm 1.4.15 → 1.4.16
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/css/admin.css +6 -1
- package/css/all.css +4 -1
- package/css/cookie-bar.css +40 -0
- package/css/elements.css +41 -0
- package/css/form-field.css +46 -0
- package/css/grid.css +8 -0
- package/css/icons.css +2 -0
- package/css/utils.css +12 -6
- package/dbm.js +1 -1
- package/ecommerce/Cart.js +44 -9
- package/ecommerce/LocalStorageCartLoader.js +7 -3
- package/flow/controllers/select/SingleSelection.js +7 -0
- package/flow/updatefunctions/basic/index.js +1 -1
- package/graphapi/webclient/decode/Relations.js +12 -0
- package/loading/index.js +34 -0
- package/package.json +1 -1
- package/react/BaseObject.js +22 -5
- package/react/admin/editor/Editor.js +5 -6
- package/react/admin/editor/fields/ArrayField.js +24 -7
- package/react/admin/editor/fields/Link.js +53 -0
- package/react/admin/editor/fields/index.js +2 -1
- package/react/admin/objects/ExploreObject.js +103 -0
- package/react/admin/objects/explore/Relation.js +67 -0
- package/react/admin/objects/explore/RelationType.js +38 -0
- package/react/admin/objects/explore/RelationTypeGroup.js +22 -0
- package/react/admin/objects/explore/index.js +3 -0
- package/react/admin/objects/index.js +3 -1
- package/react/admin/objects/itemeditors/DraggableHierarchyDisplay.js +1 -1
- package/react/admin/objects/itemeditors/TextAreaField.js +26 -0
- package/react/admin/objects/itemeditors/index.js +1 -0
- package/react/animation/AnimationController.js +1 -3
- package/react/animation/index.js +15 -0
- package/react/area/InsertElement.js +3 -0
- package/react/area/Layout.js +20 -0
- package/react/area/List.js +4 -0
- package/react/area/NativeElement.js +37 -0
- package/react/area/RepeatedSlider.js +73 -0
- package/react/area/SingleItemSlideshow.js +69 -0
- package/react/area/SlideshowSteps.js +45 -0
- package/react/area/index.js +6 -1
- package/react/blocks/admin/objects/Explore.js +18 -0
- package/react/blocks/admin/objects/index.js +2 -1
- package/react/blocks/content/Buttons.js +33 -0
- package/react/blocks/content/SectionsGrid.js +19 -0
- package/react/blocks/content/Spacing.js +13 -0
- package/react/blocks/content/SpacingLine.js +18 -0
- package/react/blocks/content/index.js +5 -1
- package/react/blocks/index.js +108 -0
- package/react/context/AddContextVariables.js +9 -4
- package/react/cookies/CookieBar.js +1 -1
- package/react/cookies/CookieOverlayMessage.js +2 -2
- package/react/dynamic/DesignRepositoryProxy.js +22 -0
- package/react/dynamic/DynamicDesignElement.js +24 -0
- package/react/dynamic/index.js +60 -0
- package/react/form/EditObjectProperty.js +15 -2
- package/react/form/EditableContent.js +71 -0
- package/react/form/GraphApiImageWithAltText.js +268 -0
- package/react/form/Link.js +40 -0
- package/react/form/Url.js +25 -0
- package/react/form/index.js +4 -0
- package/react/index.js +12 -0
- package/react/interaction/Checked.js +32 -0
- package/react/interaction/ClickOutsideTrigger.js +1 -1
- package/react/interaction/index.js +2 -1
- package/react/svg/AddGlobalFilterClasses.js +3 -3
- package/react/svg/BlendColorFilter.js +42 -0
- package/react/svg/GlobalFilters.js +1 -1
- package/react/svg/MatrixFilter.js +1 -3
- package/react/svg/index.js +20 -0
- package/react/text/index.js +4 -0
- package/repository/Item.js +8 -0
- package/repository/admin/index.js +10 -0
- package/repository/index.js +3 -0
- package/repository/proxy/RepositoryProxy.js +60 -0
- package/repository/proxy/index.js +1 -0
- package/site/BrowserUpdater.js +3 -3
- package/startup/index.js +1 -1
- package/tracking/Controller.js +14 -8
- package/tracking/DataLayerTracker.js +27 -18
- package/tracking/GtagTracker.js +112 -0
- package/tracking/MetaPixelTracker.js +1 -1
- package/tracking/SingleAccountMetaPixelTracker.js +118 -0
- package/tracking/TagManagerTracker.js +2 -2
- package/tracking/index.js +24 -0
- package/utils/svg/ColorMatrixFunctions.js +13 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class ExploreObject extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
let id = this.getPropValue("id");
|
|
9
|
+
|
|
10
|
+
this.item.requireProperty("fields", []);
|
|
11
|
+
this.item.requireProperty("incomingRelations", []);
|
|
12
|
+
this.item.requireProperty("outgoingRelations", []);
|
|
13
|
+
|
|
14
|
+
let allLoaded = Dbm.flow.updatefunctions.logic.allAtValue(Dbm.loading.LoadingStatus.LOADED);
|
|
15
|
+
this.item.requireProperty("loaded", false).addUpdate(this._getScopedCallFunctionCommand(this._loaded));
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
let request = Dbm.getGraphApi().requestRange(
|
|
19
|
+
[
|
|
20
|
+
{"type": "includePrivate"},
|
|
21
|
+
{"type": "includeDraft"},
|
|
22
|
+
{"type": "idSelection", "ids": [id]},
|
|
23
|
+
],
|
|
24
|
+
["objectTypes", "name", "identifier", "admin_fields", "relations"]
|
|
25
|
+
);
|
|
26
|
+
allLoaded.addCheck(request.properties.status);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
this.item.properties.loaded.connectInput(allLoaded.output.properties.value);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_loaded() {
|
|
33
|
+
let id = this.getPropValue("id");
|
|
34
|
+
let item = Dbm.repository.getItem(id);
|
|
35
|
+
console.log(">>>>>>>>>>", item);
|
|
36
|
+
|
|
37
|
+
let encodedFields = [];
|
|
38
|
+
let fields = item.fields;
|
|
39
|
+
for(let fieldName in fields) {
|
|
40
|
+
encodedFields.push({"name": fieldName, "value": fields[fieldName]});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this.item.fields = encodedFields;
|
|
44
|
+
|
|
45
|
+
this.item.incomingRelations = Dbm.utils.ArrayFunctions.sortOnField([].concat(item["relations/in"]["all"]), "type");
|
|
46
|
+
this.item.outgoingRelations = Dbm.utils.ArrayFunctions.sortOnField([].concat(item["relations/out"]["all"]), "type");
|
|
47
|
+
console.log(this.item.incomingRelations);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_renderMainElement() {
|
|
51
|
+
|
|
52
|
+
let id = this.getPropValue("id");
|
|
53
|
+
let item = Dbm.repository.getItem(id);
|
|
54
|
+
|
|
55
|
+
return React.createElement("div", {},
|
|
56
|
+
|
|
57
|
+
React.createElement(Dbm.react.area.HasData, {check: this.item.properties.loaded},
|
|
58
|
+
React.createElement(Dbm.react.context.AddItemByIdToContext, {"id": id},
|
|
59
|
+
|
|
60
|
+
React.createElement("h2", {"className": "no-margins"},
|
|
61
|
+
Dbm.react.text.text(Dbm.react.source.item("id")),
|
|
62
|
+
" - ",
|
|
63
|
+
Dbm.react.text.text(Dbm.react.source.item("name")),
|
|
64
|
+
),
|
|
65
|
+
React.createElement("div", {"className": "small-description"},
|
|
66
|
+
Dbm.react.text.text(Dbm.react.source.item("identifier"))
|
|
67
|
+
),
|
|
68
|
+
React.createElement("div", {"className": "spacing small"}),
|
|
69
|
+
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)"},
|
|
70
|
+
React.createElement("div", {"className": "standard-tag standard-tag-padding standard-tag-list-item inline-list-item display-inline-block"},
|
|
71
|
+
Dbm.react.text.text(Dbm.react.source.contextVariable("objectType"))
|
|
72
|
+
)
|
|
73
|
+
),
|
|
74
|
+
React.createElement("div", {"className": "spacing small"}),
|
|
75
|
+
React.createElement(Dbm.react.area.List, {items: this.item.properties.fields, "as": "field", "keyField": "name"},
|
|
76
|
+
React.createElement("div", {},
|
|
77
|
+
React.createElement("div", {},
|
|
78
|
+
Dbm.react.text.text(Dbm.react.source.contextVariable("field.name"))
|
|
79
|
+
),
|
|
80
|
+
React.createElement("div", {},
|
|
81
|
+
Dbm.react.text.text(Dbm.react.source.contextVariable("field.value"))
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
),
|
|
85
|
+
React.createElement("div", {"className": "spacing small"}),
|
|
86
|
+
React.createElement("div", {"className": "flex-row small-item-spacing halfs"},
|
|
87
|
+
React.createElement("div", {"className": "flex-row-item"},
|
|
88
|
+
React.createElement(Dbm.react.area.List, {items: this.item.properties.incomingRelations, "keyField": "type"},
|
|
89
|
+
React.createElement(Dbm.react.admin.objects.explore.RelationType, {"objectLink": "from"})
|
|
90
|
+
),
|
|
91
|
+
),
|
|
92
|
+
React.createElement("div", {"className": "flex-row-item"},
|
|
93
|
+
React.createElement(Dbm.react.area.List, {items: this.item.properties.outgoingRelations, "keyField": "type"},
|
|
94
|
+
React.createElement(Dbm.react.admin.objects.explore.RelationType, {"objectLink": "to"})
|
|
95
|
+
),
|
|
96
|
+
)
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class Relation extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
this.item.requireProperty("loaded", false);
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
_constructAfterProps() {
|
|
13
|
+
|
|
14
|
+
super._constructAfterProps();
|
|
15
|
+
|
|
16
|
+
let relation = this.getPropValue("relation");
|
|
17
|
+
let objectId = Dbm.objectPath(relation, this.getPropValue("objectLink") + ".id");
|
|
18
|
+
|
|
19
|
+
let allLoaded = Dbm.flow.updatefunctions.logic.allAtValue(Dbm.loading.LoadingStatus.LOADED);
|
|
20
|
+
|
|
21
|
+
{
|
|
22
|
+
let request = Dbm.getGraphApi().requestRange(
|
|
23
|
+
[
|
|
24
|
+
{"type": "includePrivate"},
|
|
25
|
+
{"type": "includeDraft"},
|
|
26
|
+
{"type": "idSelection", "ids": [objectId]},
|
|
27
|
+
],
|
|
28
|
+
["name", "identifier"]
|
|
29
|
+
);
|
|
30
|
+
allLoaded.addCheck(request.properties.status);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
this.item.properties.loaded.connectInput(allLoaded.output.properties.value);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_renderMainElement() {
|
|
37
|
+
|
|
38
|
+
let relation = this.getPropValue("relation");
|
|
39
|
+
let objectId = Dbm.objectPath(relation, this.getPropValue("objectLink") + ".id");
|
|
40
|
+
|
|
41
|
+
let url = "/admin/items/item/?id=" + objectId;
|
|
42
|
+
|
|
43
|
+
return this._createMainElement("div", {},
|
|
44
|
+
React.createElement(Dbm.react.text.Link, {"href": url, "className": "custom-styled-link"},
|
|
45
|
+
React.createElement("div", {"className": "flex-row small-item-spacing"},
|
|
46
|
+
React.createElement("div", {"className": "flex-row-item"},
|
|
47
|
+
Dbm.react.text.text(objectId)
|
|
48
|
+
),
|
|
49
|
+
React.createElement("div", {"className": "flex-row-item"},
|
|
50
|
+
React.createElement(Dbm.react.area.HasData, {"check": this.item.properties.loaded},
|
|
51
|
+
React.createElement(Dbm.react.context.AddItemByIdToContext, {"id": objectId},
|
|
52
|
+
Dbm.react.text.text(Dbm.react.source.item("name"))
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
),
|
|
57
|
+
React.createElement("div", {"className": "small-description"},
|
|
58
|
+
React.createElement(Dbm.react.area.HasData, {"check": this.item.properties.loaded},
|
|
59
|
+
React.createElement(Dbm.react.context.AddItemByIdToContext, {"id": objectId},
|
|
60
|
+
Dbm.react.text.text(Dbm.react.source.item("identifier"))
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class RelationType extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
_renderMainElement() {
|
|
10
|
+
|
|
11
|
+
let relationType = this.context.item;
|
|
12
|
+
let objectLink = this.getPropValue("objectLink");
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
let allTypedRelations = [];
|
|
16
|
+
|
|
17
|
+
let currentArray = relationType.allRelations;
|
|
18
|
+
let currentArrayLength = currentArray.length;
|
|
19
|
+
for(let i = 0; i < currentArrayLength; i++) {
|
|
20
|
+
let currentRelation = currentArray[i];
|
|
21
|
+
|
|
22
|
+
let currentArray2 = Dbm.objectPath(currentRelation, objectLink + ".objectTypes");
|
|
23
|
+
let currentArray2Length = currentArray2.length;
|
|
24
|
+
for(let j = 0; j < currentArray2Length; j++) {
|
|
25
|
+
allTypedRelations.push({"type": currentArray2[j], "relation": currentRelation})
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let groups = Dbm.utils.ArrayFunctions.sortOnField(Dbm.utils.ArrayFunctions.group(allTypedRelations, "type"), "key");
|
|
30
|
+
|
|
31
|
+
return this._createMainElement("div", {},
|
|
32
|
+
React.createElement("div", {}, Dbm.react.text.text(Dbm.react.source.item("type"))),
|
|
33
|
+
React.createElement(Dbm.react.area.List, {"items": groups, "as": "typeGroup"},
|
|
34
|
+
React.createElement(Dbm.react.admin.objects.explore.RelationTypeGroup, {"name": Dbm.react.source.contextVariable("typeGroup.key"), "relations": Dbm.react.source.contextVariable("typeGroup.value"), "objectLink": objectLink})
|
|
35
|
+
),
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class RelationTypeGroup extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
_renderMainElement() {
|
|
10
|
+
|
|
11
|
+
let objectLink = this.getPropValue("objectLink");
|
|
12
|
+
|
|
13
|
+
return this._createMainElement("div", {},
|
|
14
|
+
React.createElement("div", {},
|
|
15
|
+
Dbm.react.text.text(this.getPropValue("name"))
|
|
16
|
+
),
|
|
17
|
+
React.createElement(Dbm.react.area.List, {"items": this.getPropValue("relations"), "as": "relationWithType"},
|
|
18
|
+
React.createElement(Dbm.react.admin.objects.explore.Relation, {"relation": Dbm.react.source.contextVariable("relationWithType.relation"), "objectLink": objectLink})
|
|
19
|
+
)
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -5,5 +5,7 @@ export {default as InjectObjectTypeEditor} from "./InjectObjectTypeEditor.js";
|
|
|
5
5
|
export {default as RunObjectCommands} from "./RunObjectCommands.js";
|
|
6
6
|
export {default as UserList} from "./UserList.js";
|
|
7
7
|
export {default as UserListRow} from "./UserListRow.js";
|
|
8
|
+
export {default as ExploreObject} from "./ExploreObject.js";
|
|
8
9
|
|
|
9
|
-
export * as itemeditors from "./itemeditors/index.js";
|
|
10
|
+
export * as itemeditors from "./itemeditors/index.js";
|
|
11
|
+
export * as explore from "./explore/index.js";
|
|
@@ -38,7 +38,7 @@ export default class DraggableHierarchyDisplay extends Dbm.react.BaseObject {
|
|
|
38
38
|
),
|
|
39
39
|
React.createElement("div", {className: "flex-row-item flex-no-resize"},
|
|
40
40
|
React.createElement("div", {className: "spacing small"}),
|
|
41
|
-
React.createElement(Dbm.react.interaction.ConfirmButton, {"command":
|
|
41
|
+
React.createElement(Dbm.react.interaction.ConfirmButton, {"command": this._getScopedCallFunctionCommand(this._remove)},
|
|
42
42
|
React.createElement(Dbm.react.image.Image, {"src": "/assets/img/icons/delete.svg", "className": "background-contain text-row-icon action-icon-color cursor-pointer"}),
|
|
43
43
|
React.createElement("div", {"data-slot": "confirm", className: "absolute-container cursor-pointer", title: "Click to remove"},
|
|
44
44
|
React.createElement(Dbm.react.image.Image, {"src": "/assets/img/icons/delete.svg", "className": "background-contain text-row-icon hover-icon remove-action-icon-color cursor-pointer"}),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class TextAreaField extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
_renderMainElement() {
|
|
10
|
+
|
|
11
|
+
let label = this.getPropValue("label");
|
|
12
|
+
let fieldName = this.getPropValue("fieldName");
|
|
13
|
+
|
|
14
|
+
let fieldNameSource = Dbm.react.source.contextVariable("fieldName");
|
|
15
|
+
let editorValueSource = Dbm.react.source.contextVariable("valueEditor.editValue.value");
|
|
16
|
+
|
|
17
|
+
return React.createElement("div", {},
|
|
18
|
+
React.createElement("label", {className: "standard-field-label"}, label),
|
|
19
|
+
React.createElement(Dbm.react.context.AddContextVariables, {values: {"fieldName": fieldName}},
|
|
20
|
+
React.createElement(Dbm.react.admin.editorsgroup.EditField, {"fieldName": fieldNameSource},
|
|
21
|
+
React.createElement(Dbm.react.form.TextArea, {value: editorValueSource, className: "standard-field standard-field-padding full-width"})
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -20,3 +20,4 @@ export {default as RichTextField} from "./RichTextField.js";
|
|
|
20
20
|
export {default as RichTextFieldWithTranslations} from "./RichTextFieldWithTranslations.js";
|
|
21
21
|
export {default as FormattedField} from "./FormattedField.js";
|
|
22
22
|
export {default as FormattedFieldWithTranslations} from "./FormattedFieldWithTranslations.js";
|
|
23
|
+
export {default as TextAreaField} from "./TextAreaField.js";
|
package/react/animation/index.js
CHANGED
|
@@ -18,5 +18,20 @@ export const connectedAnimation = function(aStyleProperty) {
|
|
|
18
18
|
|
|
19
19
|
newAnimationController.item.propertyInput("style", aStyleProperty);
|
|
20
20
|
|
|
21
|
+
return newAnimationController;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const freeStyleTransformAnimation = function() {
|
|
25
|
+
let transform = new Dbm.flow.updatefunctions.dom.TransformStyle();
|
|
26
|
+
|
|
27
|
+
let newAnimationController = new Dbm.react.animation.AnimationController();
|
|
28
|
+
|
|
29
|
+
let styleObject = new Dbm.flow.updatefunctions.dom.StyleObject();
|
|
30
|
+
styleObject.addProperty("transform", transform.output.properties.value);
|
|
31
|
+
|
|
32
|
+
newAnimationController.item.propertyInput("style", styleObject.output.properties.style);
|
|
33
|
+
newAnimationController.item.setValue("styleProperties", styleObject);
|
|
34
|
+
newAnimationController.item.setValue("transformProperties", transform);
|
|
35
|
+
|
|
21
36
|
return newAnimationController;
|
|
22
37
|
}
|
|
@@ -20,6 +20,9 @@ export default class InsertElement extends Dbm.react.BaseObject {
|
|
|
20
20
|
if(!element) {
|
|
21
21
|
return React.createElement("div", {}, "No element set");
|
|
22
22
|
}
|
|
23
|
+
else if(typeof(element) === "string") {
|
|
24
|
+
return element;
|
|
25
|
+
}
|
|
23
26
|
|
|
24
27
|
let props = this._copyProps(element.props);
|
|
25
28
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class Layout extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
let layoutProperty = this.context.layout;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
_renderMainElement() {
|
|
12
|
+
|
|
13
|
+
let data = this.getPropValue("layout");
|
|
14
|
+
|
|
15
|
+
let layouts = Dbm.utils.ArrayFunctions.arrayOrSeparatedString(data);
|
|
16
|
+
|
|
17
|
+
return this._createMainElement(Dbm.react.area.HasData, {"check": this.context.layout, "checkType": "inArray", "compareValue": layouts}, this.getPropValue("children"));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
package/react/area/List.js
CHANGED
|
@@ -53,6 +53,10 @@ export default class List extends Dbm.react.BaseObject {
|
|
|
53
53
|
newChildren.push(React.createElement(Dbm.react.context.AddContextVariables, {key: key, values: values}, mainChildren));
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
if(slots.wrapper) {
|
|
57
|
+
newChildren = React.cloneElement(slots.wrapper[0], slots.wrapper[0].props, newChildren);
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
return React.createElement(React.Fragment, {}, newChildren);
|
|
57
61
|
}
|
|
58
62
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class NativeElement extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
_removedUsedProps(aProps) {
|
|
10
|
+
delete aProps["element"];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
componentDidMount() {
|
|
14
|
+
|
|
15
|
+
let element = this.getPropValue("element");
|
|
16
|
+
|
|
17
|
+
let parentElement = this.item.holderElement;
|
|
18
|
+
if(element && parentElement) {
|
|
19
|
+
parentElement.appendChild(element);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
componentDidUpdate() {
|
|
24
|
+
|
|
25
|
+
let element = this.getPropValue("element");
|
|
26
|
+
|
|
27
|
+
let parentElement = this.item.holderElement;
|
|
28
|
+
//METODO: should we remove the old element?
|
|
29
|
+
if(element && parentElement) {
|
|
30
|
+
parentElement.appendChild(element);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_renderMainElement() {
|
|
35
|
+
return this._createMainElement("div", {"ref": this.createRef("holderElement")});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class RepeatedSlider extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
this._sliderItems = {};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
_removedUsedProps(aProps) {
|
|
12
|
+
delete aProps["viewWidth"];
|
|
13
|
+
delete aProps["prepareLength"];
|
|
14
|
+
delete aProps["spacing"];
|
|
15
|
+
delete aProps["position"];
|
|
16
|
+
delete aProps["itemClasses"];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
_getItemForIndex(aIndex) {
|
|
20
|
+
let currentItem = this._sliderItems["i"+ aIndex];
|
|
21
|
+
if(!currentItem) {
|
|
22
|
+
currentItem = new Dbm.repository.Item();
|
|
23
|
+
currentItem.setValue("index", aIndex);
|
|
24
|
+
currentItem.setValue("envelope", 0);
|
|
25
|
+
currentItem.setValue("localPosition", 0);
|
|
26
|
+
this._sliderItems["i"+ aIndex] = currentItem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return currentItem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_renderMainElement() {
|
|
33
|
+
//console.log("FixedWidthInfiniteSlideshow::render");
|
|
34
|
+
//console.log(this);
|
|
35
|
+
|
|
36
|
+
let viewWidth = this.getPropValueWithDefault("viewWidth", 1000);
|
|
37
|
+
let prepLength = this.getPropValueWithDefault("prepareLength", 20);
|
|
38
|
+
let spacing = this.getPropValueWithDefault("spacing", 0);
|
|
39
|
+
let itemClasses = this.getPropValueWithDefault("itemClasses", "");
|
|
40
|
+
|
|
41
|
+
let position = this.getPropValueWithDefault("position", 0);
|
|
42
|
+
|
|
43
|
+
let elements = Dbm.utils.ArrayFunctions.singleOrArray(this.getPropValue("children"));
|
|
44
|
+
|
|
45
|
+
let numberOfElements = elements.length;
|
|
46
|
+
|
|
47
|
+
let length = 400;
|
|
48
|
+
|
|
49
|
+
let startIndex = Math.floor(position/length);
|
|
50
|
+
|
|
51
|
+
let endIndex = startIndex+10; //Math.floor(position);
|
|
52
|
+
|
|
53
|
+
let children = [];
|
|
54
|
+
for(let i = startIndex; i <= endIndex; i++) {
|
|
55
|
+
let currentPosition = i*length-position;
|
|
56
|
+
let elementIndex = Dbm.utils.NumberFunctions.floatMod(i, numberOfElements);
|
|
57
|
+
|
|
58
|
+
let indexItem = this._getItemForIndex(i);
|
|
59
|
+
|
|
60
|
+
let style = {"transform": "translateX(" + currentPosition + "px)", position: "absolute", left: 0, top: 0};
|
|
61
|
+
let child = React.createElement("div", {"key": i, "className": itemClasses, "style": style},
|
|
62
|
+
React.createElement(Dbm.react.context.AddContextVariables, {"values": {"sliderItem": indexItem}},
|
|
63
|
+
elements[elementIndex]
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
children.push(child);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return this._createMainElement("div", {},
|
|
70
|
+
children
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class SingleItemSlideshow extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
let indexProperty = this.getDynamicProp("index", 0);
|
|
9
|
+
|
|
10
|
+
this._contextData = {"index": indexProperty};
|
|
11
|
+
this._sliderItems = {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
_removedUsedProps(aProps) {
|
|
15
|
+
delete aProps["index"];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
_getRecordForIndex(aIndex) {
|
|
19
|
+
let currentRecord = this._sliderItems["i"+ aIndex];
|
|
20
|
+
if(!currentRecord) {
|
|
21
|
+
let currentItem = new Dbm.repository.Item();
|
|
22
|
+
currentItem.setValue("index", aIndex);
|
|
23
|
+
currentItem.setValue("envelope", 0);
|
|
24
|
+
currentItem.setValue("localPosition", 0);
|
|
25
|
+
|
|
26
|
+
currentRecord = {"item": currentItem, "contextData": {"sliderItem": currentItem}};
|
|
27
|
+
this._sliderItems["i"+ aIndex] = currentRecord;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return currentRecord;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_renderMainElement() {
|
|
34
|
+
|
|
35
|
+
let index = this.getPropValue("index");
|
|
36
|
+
|
|
37
|
+
let elements = this.getPropValue("children");
|
|
38
|
+
|
|
39
|
+
let numberOfElements = elements.length;
|
|
40
|
+
|
|
41
|
+
let startIndex = Math.floor(index);
|
|
42
|
+
let endIndex = Math.ceil(index);
|
|
43
|
+
|
|
44
|
+
let children = [];
|
|
45
|
+
for(let i = startIndex; i <= endIndex; i++) {
|
|
46
|
+
let elementIndex = Dbm.utils.NumberFunctions.floatMod(i, numberOfElements);
|
|
47
|
+
|
|
48
|
+
let currentRecord = this._getRecordForIndex(i);
|
|
49
|
+
let indexItem = currentRecord.item;
|
|
50
|
+
let localPosition = i-index;
|
|
51
|
+
indexItem.localPosition = localPosition;
|
|
52
|
+
let envelope = 1-Math.min(1, Math.abs(localPosition));
|
|
53
|
+
indexItem.envelope = envelope;
|
|
54
|
+
|
|
55
|
+
let child = React.createElement(React.Fragment, {"key": i},
|
|
56
|
+
React.createElement(Dbm.react.context.AddContextVariables, {"values": currentRecord.contextData},
|
|
57
|
+
elements[elementIndex]
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
children.push(child);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return React.createElement(React.Fragment, {},
|
|
64
|
+
React.createElement(Dbm.react.context.AddContextVariables, {"values": this._contextData},
|
|
65
|
+
children
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class SlideshowSteps extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
this._sliderItems = {};
|
|
9
|
+
|
|
10
|
+
this.getDynamicPropWithoutState("length", 0).addUpdate(this._getScopedCallFunctionCommand(this._updateSteps));
|
|
11
|
+
let value = this.getDynamicPropWithoutState("value", 0);
|
|
12
|
+
|
|
13
|
+
let singleSelection = new Dbm.flow.controllers.select.SingleSelection();
|
|
14
|
+
singleSelection.item.properties.value.connectInput(value);
|
|
15
|
+
this.item.requireProperty("singleSelection", singleSelection.item);
|
|
16
|
+
|
|
17
|
+
this.item.requireProperty("steps", []);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
_removedUsedProps(aProps) {
|
|
21
|
+
delete aProps["length"];
|
|
22
|
+
delete aProps["index"];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_updateSteps() {
|
|
26
|
+
let numberOfSteps = this.item["props/length"];
|
|
27
|
+
let steps = [];
|
|
28
|
+
|
|
29
|
+
for(let i = 0; i < numberOfSteps; i++) {
|
|
30
|
+
let selectionProperty = this.item.singleSelection.controller.addSelectionValue(i);
|
|
31
|
+
steps.push({"id": i, "selected": selectionProperty});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
this.item.steps = steps;
|
|
35
|
+
console.log(this.item.steps);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_renderMainElement() {
|
|
39
|
+
let elements = this.getPropValue("children");
|
|
40
|
+
|
|
41
|
+
return this._createMainElement(Dbm.react.area.List, {"items": this.item.properties.steps},
|
|
42
|
+
React.createElement(Dbm.react.interaction.Checked, {"checked": Dbm.react.source.item("selected"), "preventUncheck": true}, elements)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
package/react/area/index.js
CHANGED
|
@@ -13,6 +13,11 @@ export {default as SwitchableArea} from "./SwitchableArea.js";
|
|
|
13
13
|
export {default as PopoverLayer} from "./PopoverLayer.js";
|
|
14
14
|
export {default as RowOrStacked} from "./RowOrStacked.js";
|
|
15
15
|
export {default as SelectResponsiveLayout} from "./SelectResponsiveLayout.js";
|
|
16
|
+
export {default as NativeElement} from "./NativeElement.js";
|
|
17
|
+
export {default as SingleItemSlideshow} from "./SingleItemSlideshow.js";
|
|
18
|
+
export {default as SlideshowSteps} from "./SlideshowSteps.js";
|
|
19
|
+
export {default as RepeatedSlider} from "./RepeatedSlider.js";
|
|
20
|
+
export {default as Layout} from "./Layout.js";
|
|
16
21
|
|
|
17
22
|
export const responsiveLayout = function(aDefaultLayout) {
|
|
18
23
|
let newResponsiveLayout = new Dbm.react.area.ResponsiveLayout();
|
|
@@ -41,5 +46,5 @@ export const processStateElement = function(aState, aIdleElement, aProcessingEle
|
|
|
41
46
|
|
|
42
47
|
let element = React.createElement(Dbm.react.area.InsertElement, {"element": updateFunction.output.properties.value});
|
|
43
48
|
|
|
44
|
-
return
|
|
49
|
+
return element;
|
|
45
50
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class Explore extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
_renderMainElement() {
|
|
10
|
+
|
|
11
|
+
let url = new URL(document.location.href);
|
|
12
|
+
let id = url.searchParams.get("id");
|
|
13
|
+
|
|
14
|
+
return React.createElement("div", {className: "content-narrow"},
|
|
15
|
+
React.createElement(Dbm.react.admin.objects.ExploreObject, {"id": id})
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -2,4 +2,5 @@ export {default as List} from "./List.js";
|
|
|
2
2
|
export {default as Edit} from "./Edit.js";
|
|
3
3
|
export {default as RunObjectCommands} from "./RunObjectCommands.js";
|
|
4
4
|
export {default as Users} from "./Users.js";
|
|
5
|
-
export {default as User} from "./User.js";
|
|
5
|
+
export {default as User} from "./User.js";
|
|
6
|
+
export {default as Explore} from "./Explore.js";
|