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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## 0.2.6 (2023-06-17)
|
|
2
|
+
|
|
3
|
+
* Fix `al-field-schema` element not being able to get schema of an arrayable field
|
|
4
|
+
* Add `Pathway` system for faceted breadcrumbs
|
|
5
|
+
* Allow `al-select` to take in simple arrays as data
|
|
6
|
+
* Allow getting the current operator in a query builder entry
|
|
7
|
+
|
|
1
8
|
## 0.2.5 (2023-04-20)
|
|
2
9
|
|
|
3
10
|
* Add more configuration to `al-code-input`
|
package/README.md
CHANGED
|
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
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
al-pathway {
|
|
2
|
+
display: flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
al-pathway-selection {
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: 1rem;
|
|
8
|
+
|
|
9
|
+
& > .leaf-info {
|
|
10
|
+
border-radius: 5px;
|
|
11
|
+
padding: 10px;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
|
|
14
|
+
background-color: var(--pathway-leaf-bg, rgb(31, 41, 55));
|
|
15
|
+
color: var(--pathway-leaf-color, rgb(255, 255, 255));
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
background-color: var(--pathway-leaf-hover-bg, rgb(56, 69, 85));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
.al-pathway-leaf-dropdown {
|
|
25
|
+
background-color: var(--pathway-leaf-option-selection-bg, rgb(55, 65, 81));
|
|
26
|
+
color: var(--pathway-leaf-color, rgb(255, 255, 255));
|
|
27
|
+
display: flex;
|
|
28
|
+
border-radius: 5px;
|
|
29
|
+
|
|
30
|
+
.al-pathway-select-leaf-type,
|
|
31
|
+
.al-pathway-select-leaf-value {
|
|
32
|
+
padding: 10px 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.al-pathway-select-leaf-type {
|
|
36
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
ul {
|
|
40
|
+
list-style: none;
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 0;
|
|
43
|
+
|
|
44
|
+
li {
|
|
45
|
+
padding: 15px 25px;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
background-color: var(--pathway-leaf-option-selection-hover-bg, rgb(69, 84, 101));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
}
|
|
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/config/routes.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/element/30_tab_base.js
CHANGED
|
File without changes
|
package/element/40_stateful.js
CHANGED
|
File without changes
|
package/element/al_button.js
CHANGED
|
File without changes
|
package/element/al_code_input.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -21,7 +21,7 @@ FieldSchema.setTemplateFile('form/elements/alchemy_field_schema');
|
|
|
21
21
|
*
|
|
22
22
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
23
23
|
* @since 0.1.0
|
|
24
|
-
* @version 0.2.
|
|
24
|
+
* @version 0.2.6
|
|
25
25
|
*/
|
|
26
26
|
FieldSchema.setProperty(function schema() {
|
|
27
27
|
|
|
@@ -32,6 +32,8 @@ FieldSchema.setProperty(function schema() {
|
|
|
32
32
|
|
|
33
33
|
let schema = field.options.schema;
|
|
34
34
|
|
|
35
|
+
// If the schema is a string, it's actually a reference to another field
|
|
36
|
+
// that *should* contain the schema.
|
|
35
37
|
if (typeof schema == 'string') {
|
|
36
38
|
|
|
37
39
|
let parent_schema_value;
|
|
@@ -53,6 +55,17 @@ FieldSchema.setProperty(function schema() {
|
|
|
53
55
|
parent_schema_value = record_value;
|
|
54
56
|
}
|
|
55
57
|
|
|
58
|
+
// If this field is inside an array, get the index
|
|
59
|
+
let array_entry_element = field_element.queryParents('al-field-array-entry');
|
|
60
|
+
if (array_entry_element) {
|
|
61
|
+
let index = array_entry_element.index;
|
|
62
|
+
|
|
63
|
+
// If it has an index, get the value at that index
|
|
64
|
+
if (index != null && Array.isArray(parent_schema_value)) {
|
|
65
|
+
parent_schema_value = parent_schema_value[index];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
56
69
|
return field.getSubschema(parent_schema_value, schema)
|
|
57
70
|
}
|
|
58
71
|
|
|
File without changes
|
|
File without changes
|
package/element/al_label.js
CHANGED
|
File without changes
|
|
File without changes
|
package/element/al_pager.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The al-pathway element
|
|
3
|
+
*
|
|
4
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
|
+
* @since 0.2.6
|
|
6
|
+
* @version 0.2.6
|
|
7
|
+
*/
|
|
8
|
+
const Pathway = Function.inherits('Alchemy.Element.Form.Base', 'Pathway');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The hawkejs template to use
|
|
12
|
+
*
|
|
13
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
14
|
+
* @since 0.2.6
|
|
15
|
+
* @version 0.2.6
|
|
16
|
+
*/
|
|
17
|
+
Pathway.setTemplateFile('form/elements/al_pathway');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The root leaf property
|
|
21
|
+
*
|
|
22
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
23
|
+
* @since 0.2.6
|
|
24
|
+
* @version 0.2.6
|
|
25
|
+
*/
|
|
26
|
+
Pathway.setAssignedProperty('rootleaf');
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The current value
|
|
30
|
+
*
|
|
31
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
32
|
+
* @since 0.2.6
|
|
33
|
+
* @version 0.2.6
|
|
34
|
+
*/
|
|
35
|
+
Pathway.setAssignedProperty(function value(val) {
|
|
36
|
+
|
|
37
|
+
let new_val = this.getValue();
|
|
38
|
+
|
|
39
|
+
if (new_val) {
|
|
40
|
+
return new_val;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return val;
|
|
44
|
+
}, function setValue(val) {
|
|
45
|
+
|
|
46
|
+
let child = this.querySelector('.al-pathway-selection-root');
|
|
47
|
+
|
|
48
|
+
if (child) {
|
|
49
|
+
child.value = val;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Get the current value
|
|
56
|
+
*
|
|
57
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
58
|
+
* @since 0.2.6
|
|
59
|
+
* @version 0.2.6
|
|
60
|
+
*/
|
|
61
|
+
Pathway.setMethod(function getValue() {
|
|
62
|
+
|
|
63
|
+
let child = this.querySelector('.al-pathway-selection-root');
|
|
64
|
+
|
|
65
|
+
if (child) {
|
|
66
|
+
return child.getValue();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Incoming change
|
|
72
|
+
*
|
|
73
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
74
|
+
* @since 0.2.6
|
|
75
|
+
* @version 0.2.6
|
|
76
|
+
*
|
|
77
|
+
* @param {PathwaySelection} element
|
|
78
|
+
*/
|
|
79
|
+
Pathway.setMethod(function triggerChange(element) {
|
|
80
|
+
|
|
81
|
+
alchemy.emit('story_pathway', this, element);
|
|
82
|
+
});
|