alchemy-form 0.2.5 → 0.2.6
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/CHANGELOG.md +7 -0
- package/README.md +0 -0
- package/assets/stylesheets/form/alchemy_form.scss +0 -0
- package/assets/stylesheets/form/elements/_button.scss +0 -0
- package/assets/stylesheets/form/elements/_code_input.scss +0 -0
- package/assets/stylesheets/form/elements/_feedback_input.scss +0 -0
- package/assets/stylesheets/form/elements/_field.scss +0 -0
- package/assets/stylesheets/form/elements/_field_array.scss +0 -0
- package/assets/stylesheets/form/elements/_field_translatable.scss +0 -0
- package/assets/stylesheets/form/elements/_form.scss +0 -0
- package/assets/stylesheets/form/elements/_pager.scss +0 -0
- package/assets/stylesheets/form/elements/_pathway.scss +56 -0
- package/assets/stylesheets/form/elements/_query_builder.scss +0 -0
- package/assets/stylesheets/form/elements/_select.scss +0 -0
- package/assets/stylesheets/form/elements/_state.scss +0 -0
- package/assets/stylesheets/form/elements/_table.scss +0 -0
- package/assets/stylesheets/form/elements/_tabs.scss +0 -0
- package/assets/stylesheets/form/elements/_toggle.scss +0 -0
- package/assets/stylesheets/form/elements/index.scss +2 -1
- package/assets/stylesheets/form/general/_colors.scss +0 -0
- package/assets/stylesheets/form/general/_textsizes.scss +0 -0
- package/assets/stylesheets/form/general/index.scss +0 -0
- package/config/routes.js +0 -0
- package/controller/form_api_controller.js +0 -0
- package/element/10_alchemy_field_custom.js +0 -0
- package/element/10_dataprovider.js +0 -0
- package/element/15_alchemy_field_entry.js +0 -0
- package/element/20_query_builder_base.js +0 -0
- package/element/25_query_builder_data.js +0 -2
- package/element/30_tab_base.js +0 -0
- package/element/40_stateful.js +0 -0
- package/element/al_button.js +0 -0
- package/element/al_code_input.js +0 -0
- package/element/al_field_array.js +0 -0
- package/element/al_field_array_entry.js +0 -0
- package/element/al_field_schema.js +14 -1
- package/element/al_field_translatable.js +0 -0
- package/element/al_field_translatable_entry.js +0 -0
- package/element/al_label.js +0 -0
- package/element/al_number_input.js +0 -0
- package/element/al_pager.js +0 -0
- package/element/al_password_input.js +0 -0
- package/element/al_pathway.js +82 -0
- package/element/al_pathway_selection.js +690 -0
- package/element/al_query_builder.js +0 -0
- package/element/al_query_builder_entry.js +18 -3
- package/element/al_query_builder_group.js +0 -0
- package/element/al_query_builder_value.js +0 -0
- package/element/al_query_builder_variable.js +0 -0
- package/element/al_select.js +6 -2
- package/element/al_select_item.js +0 -0
- package/element/al_state.js +0 -0
- package/element/al_tab_button.js +0 -0
- package/element/al_tab_context.js +0 -0
- package/element/al_tab_list.js +0 -0
- package/element/al_tab_panel.js +0 -0
- package/element/al_table.js +0 -0
- package/element/al_toggle.js +0 -0
- package/helper/form_actions/00_form_action.js +0 -0
- package/helper/form_actions/url_action.js +0 -0
- package/helper/pathway/leaf.js +174 -0
- package/helper/query_builder_ns.js +0 -0
- package/helper/query_builder_variable_definition/00_variable_definition.js +0 -0
- package/helper/query_builder_variable_definition/boolean_variable_definition.js +0 -0
- package/helper/query_builder_variable_definition/list_variable_definition.js +0 -0
- package/helper/query_builder_variable_definition/number_variable_definition.js +0 -0
- package/helper/query_builder_variable_definition/string_variable_definition.js +0 -0
- package/helper_field/query_builder_assignment.js +0 -0
- package/helper_field/query_builder_field.js +0 -0
- package/helper_field/query_builder_value.js +0 -0
- package/helper_field/query_builder_variable.js +0 -0
- package/package.json +2 -2
- package/view/form/elements/al_pathway.hwk +5 -0
- package/view/form/elements/al_pathway_selection.hwk +10 -0
- package/view/form/elements/alchemy_button.hwk +0 -0
- package/view/form/elements/alchemy_field_array.hwk +0 -0
- package/view/form/elements/alchemy_field_array_entry.hwk +0 -0
- package/view/form/elements/alchemy_field_schema.hwk +0 -0
- package/view/form/elements/alchemy_field_translatable.hwk +0 -0
- package/view/form/elements/alchemy_field_translatable_entry.hwk +0 -0
- package/view/form/elements/alchemy_select.hwk +0 -0
- package/view/form/elements/alchemy_select_item.hwk +0 -0
- package/view/form/elements/alchemy_toggle.hwk +0 -0
- package/view/form/elements/code_input.hwk +0 -0
- package/view/form/elements/number_input.hwk +0 -0
- package/view/form/elements/password_input.hwk +0 -0
- package/view/form/elements/query_builder.hwk +0 -0
- package/view/form/elements/query_builder_entry.hwk +0 -0
- package/view/form/elements/query_builder_group.hwk +0 -0
- package/view/form/elements/query_builder_value.hwk +0 -0
- package/view/form/elements/query_builder_variable.hwk +0 -0
- package/view/form/inputs/edit/belongs_to.hwk +0 -0
- package/view/form/inputs/edit/boolean.hwk +0 -0
- package/view/form/inputs/edit/date.hwk +0 -0
- package/view/form/inputs/edit/datetime.hwk +0 -0
- package/view/form/inputs/edit/enum.hwk +0 -0
- package/view/form/inputs/edit/has_and_belongs_to_many.hwk +0 -0
- package/view/form/inputs/edit/has_one_parent.hwk +0 -0
- package/view/form/inputs/edit/html.hwk +0 -0
- package/view/form/inputs/edit/number.hwk +0 -0
- package/view/form/inputs/edit/query_builder.hwk +0 -0
- package/view/form/inputs/edit/query_builder_assignment.hwk +0 -0
- package/view/form/inputs/edit/query_builder_value.hwk +0 -0
- package/view/form/inputs/edit/query_builder_variable.hwk +0 -0
- package/view/form/inputs/edit/schema.hwk +0 -0
- package/view/form/inputs/edit/sourcecode.hwk +0 -0
- package/view/form/inputs/edit/string.hwk +0 -0
- package/view/form/inputs/edit/text.hwk +0 -0
- package/view/form/inputs/edit_inline/boolean.hwk +0 -0
- package/view/form/inputs/view/datetime.hwk +0 -0
- package/view/form/inputs/view/string.hwk +0 -0
- package/view/form/inputs/view_inline/boolean.hwk +0 -0
- package/view/form/inputs/view_inline/date.hwk +0 -0
- package/view/form/inputs/view_inline/datetime.hwk +0 -0
- package/view/form/inputs/view_inline/enum.hwk +0 -0
- package/view/form/inputs/view_inline/objectid.hwk +0 -0
- package/view/form/inputs/view_inline/string.hwk +0 -0
- package/view/form/select/qb_item.hwk +0 -0
- package/view/form/wrappers/default/default.hwk +0 -0
- package/view/form/wrappers/edit_inline/default.hwk +0 -0
- package/view/form/wrappers/view_inline/default.hwk +0 -0
|
File without changes
|
package/element/al_select.js
CHANGED
|
@@ -854,7 +854,7 @@ AlchemySelect.setMethod(function _processPreloadedValues() {
|
|
|
854
854
|
*
|
|
855
855
|
* @author Jelle De Loecker <jelle@develry.be>
|
|
856
856
|
* @since 0.1.0
|
|
857
|
-
* @version 0.
|
|
857
|
+
* @version 0.2.6
|
|
858
858
|
*
|
|
859
859
|
* @param {Object} response
|
|
860
860
|
* @param {Number} page The page, if it's via pagination
|
|
@@ -872,7 +872,11 @@ AlchemySelect.setMethod(function _processResponseData(response, page) {
|
|
|
872
872
|
let records = response.items || response.records;
|
|
873
873
|
|
|
874
874
|
if (!records) {
|
|
875
|
-
|
|
875
|
+
if (Array.isArray(response)) {
|
|
876
|
+
records = response;
|
|
877
|
+
} else {
|
|
878
|
+
records = [];
|
|
879
|
+
}
|
|
876
880
|
}
|
|
877
881
|
|
|
878
882
|
this._processResponseList(records, page);
|
|
File without changes
|
package/element/al_state.js
CHANGED
|
File without changes
|
package/element/al_tab_button.js
CHANGED
|
File without changes
|
|
File without changes
|
package/element/al_tab_list.js
CHANGED
|
File without changes
|
package/element/al_tab_panel.js
CHANGED
|
File without changes
|
package/element/al_table.js
CHANGED
|
File without changes
|
package/element/al_toggle.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Pathway tree
|
|
3
|
+
*
|
|
4
|
+
* @constructor
|
|
5
|
+
*
|
|
6
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
7
|
+
* @since 0.2.6
|
|
8
|
+
* @version 0.2.6
|
|
9
|
+
*
|
|
10
|
+
* @param {Leaf} parent Optional parent leaf
|
|
11
|
+
*/
|
|
12
|
+
const Leaf = Function.inherits('Alchemy.Base', 'Alchemy.Form.Pathway', function Leaf(id, parent) {
|
|
13
|
+
|
|
14
|
+
// The id of this leaf
|
|
15
|
+
this.id = id;
|
|
16
|
+
|
|
17
|
+
// The parent leaf
|
|
18
|
+
this.parent = parent;
|
|
19
|
+
|
|
20
|
+
// The children
|
|
21
|
+
this.children = [];
|
|
22
|
+
|
|
23
|
+
// The data provider
|
|
24
|
+
this._provider = null;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Undry
|
|
29
|
+
*
|
|
30
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
31
|
+
* @since 0.2.6
|
|
32
|
+
* @version 0.2.6
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} obj
|
|
35
|
+
* @param {Boolean|String} cloned
|
|
36
|
+
*
|
|
37
|
+
* @return {Leaf}
|
|
38
|
+
*/
|
|
39
|
+
Leaf.setStatic(function unDry(obj) {
|
|
40
|
+
|
|
41
|
+
let result = new this(obj.id);
|
|
42
|
+
|
|
43
|
+
if (obj.children) {
|
|
44
|
+
for (let child of obj.children) {
|
|
45
|
+
child.parent = result;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
result.children = obj.children;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
result._provider = obj.provider;
|
|
52
|
+
|
|
53
|
+
return result;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Get the displaytitle of this leaf
|
|
58
|
+
*
|
|
59
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
60
|
+
* @since 0.2.6
|
|
61
|
+
* @version 0.2.6
|
|
62
|
+
*
|
|
63
|
+
* @return {Microcopy}
|
|
64
|
+
*/
|
|
65
|
+
Leaf.setMethod(function getDisplayTitle() {
|
|
66
|
+
|
|
67
|
+
let key = 'pathway-leaf-title',
|
|
68
|
+
params = {leaf_id: this.id};
|
|
69
|
+
|
|
70
|
+
return new Classes.Alchemy.Microcopy(key, params);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Add a new child
|
|
75
|
+
*
|
|
76
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
77
|
+
* @since 0.2.6
|
|
78
|
+
* @version 0.2.6
|
|
79
|
+
*
|
|
80
|
+
* @return {Leaf}
|
|
81
|
+
*/
|
|
82
|
+
Leaf.setMethod(function addChild(id) {
|
|
83
|
+
|
|
84
|
+
let leaf = new Leaf(id, this);
|
|
85
|
+
|
|
86
|
+
this.children.push(leaf);
|
|
87
|
+
|
|
88
|
+
return leaf;
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Set the data provider
|
|
93
|
+
*
|
|
94
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
95
|
+
* @since 0.2.6
|
|
96
|
+
* @version 0.2.6
|
|
97
|
+
*/
|
|
98
|
+
Leaf.setMethod(function setProvider(provider) {
|
|
99
|
+
this._provider = provider;
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Get the data provider
|
|
104
|
+
*
|
|
105
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
106
|
+
* @since 0.2.6
|
|
107
|
+
* @version 0.2.6
|
|
108
|
+
*
|
|
109
|
+
* @return {DataProvider}
|
|
110
|
+
*/
|
|
111
|
+
Leaf.setMethod(function getProvider() {
|
|
112
|
+
|
|
113
|
+
if (typeof this._provider == 'string') {
|
|
114
|
+
let provider = new Classes.Alchemy.DataProvider.Remote();
|
|
115
|
+
provider.source = alchemy.routeUrl(this._provider);
|
|
116
|
+
|
|
117
|
+
provider.context = {
|
|
118
|
+
leaf_id : this.id
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return provider;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Get the given page
|
|
129
|
+
*
|
|
130
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
131
|
+
* @since 0.2.6
|
|
132
|
+
* @version 0.2.6
|
|
133
|
+
*
|
|
134
|
+
* @return {DataProvider}
|
|
135
|
+
*/
|
|
136
|
+
Leaf.setMethod(async function getPage(page_nr) {
|
|
137
|
+
|
|
138
|
+
let provider = this.getProvider();
|
|
139
|
+
|
|
140
|
+
console.log('Getting page...', page_nr, 'from', provider)
|
|
141
|
+
|
|
142
|
+
if (!provider) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
let records = await provider.getAll();
|
|
147
|
+
|
|
148
|
+
console.log('Got records:', records)
|
|
149
|
+
|
|
150
|
+
return records;
|
|
151
|
+
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Return an object for json-drying this document
|
|
156
|
+
*
|
|
157
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
158
|
+
* @since 0.2.6
|
|
159
|
+
* @version 0.2.6
|
|
160
|
+
*
|
|
161
|
+
* @return {Object}
|
|
162
|
+
*/
|
|
163
|
+
Leaf.setMethod(function toDry() {
|
|
164
|
+
|
|
165
|
+
let result = {
|
|
166
|
+
value : {
|
|
167
|
+
id : this.id,
|
|
168
|
+
provider : this._provider,
|
|
169
|
+
children : this.children,
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
return result;
|
|
174
|
+
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alchemy-form",
|
|
3
3
|
"description": "Form plugin for Alchemy",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.6",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type" : "git",
|
|
7
7
|
"url" : "https://github.com/11ways/alchemy-form.git"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"alchemymvc" : ">=1.
|
|
10
|
+
"alchemymvc" : ">=1.3.0",
|
|
11
11
|
"alchemy-media" : ">=0.7.2"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|