alchemy-form 0.1.11 → 0.2.0
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 +29 -0
- package/assets/stylesheets/form/alchemy_form.scss +2 -16
- package/assets/stylesheets/form/elements/_button.scss +52 -0
- package/assets/stylesheets/form/{alchemy_code_input.scss → elements/_code_input.scss} +1 -1
- package/assets/stylesheets/form/{alchemy_feedback_input.scss → elements/_feedback_input.scss} +6 -8
- package/assets/stylesheets/form/{alchemy_field.scss → elements/_field.scss} +1 -1
- package/assets/stylesheets/form/{alchemy_field_array.scss → elements/_field_array.scss} +2 -2
- package/assets/stylesheets/form/{alchemy_field_translatable.scss → elements/_field_translatable.scss} +1 -1
- package/assets/stylesheets/form/elements/_form.scss +16 -0
- package/assets/stylesheets/form/{alchemy_pager.scss → elements/_pager.scss} +1 -1
- package/assets/stylesheets/form/{query_builder.scss → elements/_query_builder.scss} +7 -7
- package/assets/stylesheets/form/{alchemy_select.scss → elements/_select.scss} +2 -2
- package/assets/stylesheets/form/elements/_state.scss +8 -0
- package/assets/stylesheets/form/{alchemy_table.scss → elements/_table.scss} +2 -2
- package/assets/stylesheets/form/elements/_tabs.scss +47 -0
- package/assets/stylesheets/form/{alchemy_toggle.scss → elements/_toggle.scss} +1 -1
- package/assets/stylesheets/form/elements/index.scss +14 -0
- package/controller/form_api_controller.js +0 -1
- package/element/00_form_base.js +16 -8
- package/element/05_feedback_input.js +4 -13
- package/element/10_alchemy_field_custom.js +13 -15
- package/element/10_dataprovider.js +282 -0
- package/element/15_alchemy_field_entry.js +8 -10
- package/element/20_query_builder_base.js +4 -13
- package/element/25_query_builder_data.js +2 -2
- package/element/30_tab_base.js +29 -0
- package/element/40_stateful.js +125 -0
- package/element/al_button.js +109 -0
- package/element/{code_input.js → al_code_input.js} +1 -10
- package/element/{alchemy_field.js → al_field.js} +82 -41
- package/element/{alchemy_field_array.js → al_field_array.js} +7 -18
- package/element/{alchemy_field_array_entry.js → al_field_array_entry.js} +7 -9
- package/element/{alchemy_field_schema.js → al_field_schema.js} +23 -11
- package/element/{alchemy_field_translatable.js → al_field_translatable.js} +6 -17
- package/element/{alchemy_field_translatable_entry.js → al_field_translatable_entry.js} +2 -4
- package/element/{alchemy_form.js → al_form.js} +7 -16
- package/element/{alchemy_label.js → al_label.js} +1 -10
- package/element/{number_input.js → al_number_input.js} +2 -2
- package/element/{alchemy_pager.js → al_pager.js} +49 -41
- package/element/{alchemy_password_input.js → al_password_input.js} +0 -0
- package/element/{query_builder.js → al_query_builder.js} +3 -12
- package/element/{query_builder_entry.js → al_query_builder_entry.js} +8 -7
- package/element/{query_builder_group.js → al_query_builder_group.js} +7 -7
- package/element/{query_builder_value.js → al_query_builder_value.js} +2 -2
- package/element/{query_builder_variable.js → al_query_builder_variable.js} +1 -1
- package/element/{alchemy_select.js → al_select.js} +35 -108
- package/element/{alchemy_select_item.js → al_select_item.js} +33 -13
- package/element/al_state.js +26 -0
- package/element/{string_input.js → al_string_input.js} +2 -2
- package/element/al_tab_button.js +138 -0
- package/element/al_tab_context.js +102 -0
- package/element/al_tab_list.js +66 -0
- package/element/al_tab_panel.js +44 -0
- package/element/{alchemy_table.js → al_table.js} +204 -185
- package/element/{alchemy_toggle.js → al_toggle.js} +1 -10
- package/helper/form_actions/00_form_action.js +15 -4
- package/helper/form_actions/url_action.js +3 -2
- package/helper/query_builder_ns.js +108 -0
- package/helper/query_builder_variable_definition/00_variable_definition.js +52 -1
- package/helper/query_builder_variable_definition/boolean_variable_definition.js +1 -1
- package/helper_field/query_builder_field.js +49 -28
- package/helper_field/query_builder_value.js +0 -45
- package/helper_field/query_builder_variable.js +0 -45
- package/package.json +2 -2
- package/view/form/elements/alchemy_button.hwk +1 -0
- package/view/form/elements/alchemy_field.hwk +4 -4
- package/view/form/elements/alchemy_field_array.hwk +2 -2
- package/view/form/elements/alchemy_field_schema.hwk +2 -2
- package/view/form/elements/alchemy_field_translatable.hwk +2 -2
- package/view/form/elements/alchemy_field_translatable_entry.hwk +2 -2
- package/view/form/elements/alchemy_select_item.hwk +1 -3
- package/view/form/elements/query_builder.hwk +1 -1
- package/view/form/elements/query_builder_entry.hwk +6 -6
- package/view/form/elements/query_builder_value.hwk +2 -2
- package/view/form/elements/query_builder_variable.hwk +2 -2
- package/view/form/inputs/edit/belongs_to.hwk +2 -2
- package/view/form/inputs/edit/boolean.hwk +2 -2
- package/view/form/inputs/edit/enum.hwk +2 -2
- package/view/form/inputs/edit/has_and_belongs_to_many.hwk +2 -2
- package/view/form/inputs/edit/html.hwk +2 -2
- package/view/form/inputs/edit/query_builder.hwk +2 -2
- package/view/form/inputs/edit/query_builder_assignment.hwk +2 -2
- package/view/form/inputs/edit/query_builder_value.hwk +2 -2
- package/view/form/inputs/edit/query_builder_variable.hwk +2 -2
- package/view/form/inputs/edit/schema.hwk +2 -2
- package/view/form/inputs/edit/sourcecode.hwk +2 -2
- package/view/form/inputs/edit_inline/boolean.hwk +2 -2
- package/view/form/inputs/view/string.hwk +6 -1
- package/view/form/inputs/view_inline/datetime.hwk +8 -4
- package/view/form/inputs/view_inline/enum.hwk +1 -0
- package/view/form/inputs/view_inline/string.hwk +6 -1
- package/view/form/select/qb_item.hwk +1 -0
- package/view/form/wrappers/default/default.hwk +2 -2
- package/helper/widgets/alchemy_field_widget.js +0 -137
- package/helper/widgets/alchemy_form_widget.js +0 -169
- package/helper/widgets/alchemy_table_widget.js +0 -53
- package/view/form/inputs/view_inline/file.hwk +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The al-field element
|
|
3
3
|
*
|
|
4
4
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.1.0
|
|
@@ -16,15 +16,6 @@ const Field = Function.inherits('Alchemy.Element.Form.Base', 'Field');
|
|
|
16
16
|
*/
|
|
17
17
|
Field.setTemplateFile('form/elements/alchemy_field');
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* The stylesheet to load for this element
|
|
21
|
-
*
|
|
22
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
23
|
-
* @since 0.1.0
|
|
24
|
-
* @version 0.1.0
|
|
25
|
-
*/
|
|
26
|
-
Field.setStylesheetFile('form/alchemy_field');
|
|
27
|
-
|
|
28
19
|
/**
|
|
29
20
|
* Use a new Renderer scope for the contents
|
|
30
21
|
*
|
|
@@ -70,6 +61,15 @@ Field.setAttribute('field-type');
|
|
|
70
61
|
*/
|
|
71
62
|
Field.setAttribute('field-view');
|
|
72
63
|
|
|
64
|
+
/**
|
|
65
|
+
* The wrapper view override
|
|
66
|
+
*
|
|
67
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
68
|
+
* @since 0.1.12
|
|
69
|
+
* @version 0.1.12
|
|
70
|
+
*/
|
|
71
|
+
Field.setAttribute('wrapper-view');
|
|
72
|
+
|
|
73
73
|
/**
|
|
74
74
|
* Is this a read only field?
|
|
75
75
|
*
|
|
@@ -89,19 +89,19 @@ Field.setAttribute('readonly', {boolean: true});
|
|
|
89
89
|
Field.setAssignedProperty('widget_settings');
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
|
-
* Get the parent
|
|
92
|
+
* Get the parent al-form element
|
|
93
93
|
*
|
|
94
94
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
95
95
|
* @since 0.1.0
|
|
96
|
-
* @version 0.
|
|
96
|
+
* @version 0.2.0
|
|
97
97
|
*/
|
|
98
98
|
Field.enforceProperty(function alchemy_form(new_value) {
|
|
99
99
|
|
|
100
100
|
if (new_value == null) {
|
|
101
|
-
new_value = this.queryUp('
|
|
101
|
+
new_value = this.queryUp('al-form');
|
|
102
102
|
|
|
103
103
|
if (!new_value && this.field_context) {
|
|
104
|
-
new_value = this.field_context.queryUp('
|
|
104
|
+
new_value = this.field_context.queryUp('al-form');
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
if (!new_value && this.alchemy_field_schema && this.alchemy_field_schema.alchemy_field) {
|
|
@@ -122,16 +122,16 @@ Field.enforceProperty(function alchemy_form(new_value) {
|
|
|
122
122
|
Field.addElementGetter('error_area', '.error-area');
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
|
-
* Get the optional
|
|
125
|
+
* Get the optional al-field-schema it belongs to
|
|
126
126
|
*
|
|
127
127
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
128
128
|
* @since 0.1.0
|
|
129
|
-
* @version 0.
|
|
129
|
+
* @version 0.2.0
|
|
130
130
|
*/
|
|
131
131
|
Field.enforceProperty(function alchemy_field_schema(new_value, old_value) {
|
|
132
132
|
|
|
133
133
|
if (!new_value) {
|
|
134
|
-
new_value = this.queryUp('
|
|
134
|
+
new_value = this.queryUp('al-field-schema');
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
return new_value;
|
|
@@ -180,7 +180,7 @@ Field.enforceProperty(function schema(new_value, old_value) {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
// See if the
|
|
183
|
+
// See if the al-form element has an explicit schema instance
|
|
184
184
|
if (!new_value && this.alchemy_form) {
|
|
185
185
|
new_value = this.alchemy_form.schema;
|
|
186
186
|
}
|
|
@@ -260,22 +260,19 @@ Field.setProperty(function is_translatable() {
|
|
|
260
260
|
*
|
|
261
261
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
262
262
|
* @since 0.1.0
|
|
263
|
-
* @version 0.1.
|
|
263
|
+
* @version 0.1.12
|
|
264
264
|
*/
|
|
265
265
|
Field.setProperty(function field_title() {
|
|
266
266
|
|
|
267
|
-
let
|
|
268
|
-
result;
|
|
269
|
-
|
|
270
|
-
if (config) {
|
|
271
|
-
result = config.title;
|
|
272
|
-
}
|
|
267
|
+
let result = this._title || this.widget_settings?.title || this.config?.title;
|
|
273
268
|
|
|
274
269
|
if (!result && this.field_name) {
|
|
275
270
|
result = this.field_name.titleize();
|
|
276
271
|
}
|
|
277
272
|
|
|
278
273
|
return result;
|
|
274
|
+
}, function setTitle(value) {
|
|
275
|
+
this._title = value;
|
|
279
276
|
});
|
|
280
277
|
|
|
281
278
|
/**
|
|
@@ -283,16 +280,11 @@ Field.setProperty(function field_title() {
|
|
|
283
280
|
*
|
|
284
281
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
285
282
|
* @since 0.1.0
|
|
286
|
-
* @version 0.1.
|
|
283
|
+
* @version 0.1.12
|
|
287
284
|
*/
|
|
288
285
|
Field.setProperty(function field_description() {
|
|
289
286
|
|
|
290
|
-
let
|
|
291
|
-
result;
|
|
292
|
-
|
|
293
|
-
if (config && config.options) {
|
|
294
|
-
result = config.options.description;
|
|
295
|
-
}
|
|
287
|
+
let result = this.widget_settings?.description || this.config?.description;
|
|
296
288
|
|
|
297
289
|
return result;
|
|
298
290
|
});
|
|
@@ -393,11 +385,11 @@ Field.enforceProperty(function wrapper_file(new_value, old_value) {
|
|
|
393
385
|
return false;
|
|
394
386
|
}
|
|
395
387
|
|
|
396
|
-
let
|
|
388
|
+
let wrapper_view = this.wrapper_view || this.getFieldType(),
|
|
397
389
|
view_type = this.view_type;
|
|
398
390
|
|
|
399
|
-
if (
|
|
400
|
-
return this.generateTemplatePath('wrappers', view_type,
|
|
391
|
+
if (wrapper_view) {
|
|
392
|
+
return this.generateTemplatePath('wrappers', view_type, wrapper_view);
|
|
401
393
|
}
|
|
402
394
|
}
|
|
403
395
|
|
|
@@ -534,7 +526,7 @@ Field.setProperty(function original_value() {
|
|
|
534
526
|
*
|
|
535
527
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
536
528
|
* @since 0.1.0
|
|
537
|
-
* @version 0.
|
|
529
|
+
* @version 0.2.0
|
|
538
530
|
*/
|
|
539
531
|
Field.setProperty(function value_element() {
|
|
540
532
|
|
|
@@ -542,11 +534,11 @@ Field.setProperty(function value_element() {
|
|
|
542
534
|
|
|
543
535
|
// Translations always get preference
|
|
544
536
|
if (this.is_translatable) {
|
|
545
|
-
input = this.querySelector('
|
|
537
|
+
input = this.querySelector('al-field-translatable');
|
|
546
538
|
} else if (this.is_array) {
|
|
547
|
-
input = this.querySelector('
|
|
539
|
+
input = this.querySelector('al-field-array');
|
|
548
540
|
} else if (this.contains_schema) {
|
|
549
|
-
input = this.querySelector('
|
|
541
|
+
input = this.querySelector('al-field-schema');
|
|
550
542
|
}
|
|
551
543
|
|
|
552
544
|
if (!input) {
|
|
@@ -584,6 +576,55 @@ Field.setProperty(function value() {
|
|
|
584
576
|
}
|
|
585
577
|
});
|
|
586
578
|
|
|
579
|
+
/**
|
|
580
|
+
* Apply options
|
|
581
|
+
*
|
|
582
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
583
|
+
* @since 0.1.12
|
|
584
|
+
* @version 0.1.12
|
|
585
|
+
*
|
|
586
|
+
* @param {Object} options
|
|
587
|
+
*/
|
|
588
|
+
Field.setMethod(function applyOptions(options) {
|
|
589
|
+
|
|
590
|
+
if (!options || typeof options != 'object') {
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
if (options.purpose) {
|
|
595
|
+
this.purpose = options.purpose;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
if (options.mode) {
|
|
599
|
+
this.mode = options.mode;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
if (options.view) {
|
|
603
|
+
this.field_view = options.view;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
if (options.wrapper) {
|
|
607
|
+
this.wrapper_view = options.wrapper;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
if (options.readonly) {
|
|
611
|
+
this.readonly = true;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
if (options.widget_settings) {
|
|
615
|
+
this.widget_settings = options.widget_settings;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
if (options.data_src) {
|
|
619
|
+
this.data_src = options.data_src;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
if (options.title) {
|
|
623
|
+
this.field_title = options.title;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
});
|
|
627
|
+
|
|
587
628
|
/**
|
|
588
629
|
* Get the field type
|
|
589
630
|
*
|
|
@@ -729,7 +770,7 @@ Field.setMethod(function removeErrors() {
|
|
|
729
770
|
*
|
|
730
771
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
731
772
|
* @since 0.1.0
|
|
732
|
-
* @version 0.
|
|
773
|
+
* @version 0.2.0
|
|
733
774
|
*/
|
|
734
775
|
Field.setMethod(function retained() {
|
|
735
776
|
|
|
@@ -745,7 +786,7 @@ Field.setMethod(function retained() {
|
|
|
745
786
|
this.id = id;
|
|
746
787
|
}
|
|
747
788
|
|
|
748
|
-
let label = this.querySelector('.form-field-info
|
|
789
|
+
let label = this.querySelector('.form-field-info al-label');
|
|
749
790
|
|
|
750
791
|
if (label && this.value_element) {
|
|
751
792
|
let v_id = this.id + '_fv';
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The al-field-array element
|
|
3
3
|
*
|
|
4
4
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.1.0
|
|
6
6
|
* @version 0.1.0
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
FieldArray.super.call(this);
|
|
10
|
-
});
|
|
8
|
+
const FieldArray = Function.inherits('Alchemy.Element.Form.FieldCustom', 'FieldArray');
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* The template to use for the content of this element
|
|
@@ -18,25 +16,16 @@ var FieldArray = Function.inherits('Alchemy.Element.Form.FieldCustom', function
|
|
|
18
16
|
*/
|
|
19
17
|
FieldArray.setTemplateFile('form/elements/alchemy_field_array');
|
|
20
18
|
|
|
21
|
-
/**
|
|
22
|
-
* The stylesheet to load for this element
|
|
23
|
-
*
|
|
24
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
25
|
-
* @since 0.1.0
|
|
26
|
-
* @version 0.1.0
|
|
27
|
-
*/
|
|
28
|
-
FieldArray.setStylesheetFile('form/alchemy_field_array');
|
|
29
|
-
|
|
30
19
|
/**
|
|
31
20
|
* Get the live value
|
|
32
21
|
*
|
|
33
22
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
34
23
|
* @since 0.1.0
|
|
35
|
-
* @version 0.
|
|
24
|
+
* @version 0.2.0
|
|
36
25
|
*/
|
|
37
26
|
FieldArray.setProperty(function value() {
|
|
38
27
|
|
|
39
|
-
let entries = this.queryAllNotNested('
|
|
28
|
+
let entries = this.queryAllNotNested('al-field-array-entry'),
|
|
40
29
|
result = [],
|
|
41
30
|
entry,
|
|
42
31
|
i;
|
|
@@ -58,7 +47,7 @@ FieldArray.setProperty(function value() {
|
|
|
58
47
|
*
|
|
59
48
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
60
49
|
* @since 0.1.0
|
|
61
|
-
* @version 0.
|
|
50
|
+
* @version 0.2.0
|
|
62
51
|
*/
|
|
63
52
|
FieldArray.setMethod(function introduced() {
|
|
64
53
|
|
|
@@ -68,7 +57,7 @@ FieldArray.setMethod(function introduced() {
|
|
|
68
57
|
|
|
69
58
|
e.preventDefault();
|
|
70
59
|
|
|
71
|
-
let entry = e.target.queryUp('
|
|
60
|
+
let entry = e.target.queryUp('al-field-array-entry');
|
|
72
61
|
|
|
73
62
|
entry.remove();
|
|
74
63
|
});
|
|
@@ -89,7 +78,7 @@ FieldArray.setMethod(function introduced() {
|
|
|
89
78
|
throw new Error('Unable to add new entry for field "' + alchemy_field.field_title + '", no view files found');
|
|
90
79
|
}
|
|
91
80
|
|
|
92
|
-
let new_entry = that.createElement('
|
|
81
|
+
let new_entry = that.createElement('al-field-array-entry');
|
|
93
82
|
|
|
94
83
|
new_entry.alchemy_field_array = that;
|
|
95
84
|
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The al-field-array-entry element
|
|
3
3
|
*
|
|
4
4
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.1.0
|
|
6
6
|
* @version 0.1.0
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
FieldArrayEntry.super.call(this);
|
|
10
|
-
});
|
|
8
|
+
const FieldArrayEntry = Function.inherits('Alchemy.Element.Form.FieldEntry', 'FieldArrayEntry');
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* The template to use for the content of this element
|
|
@@ -19,16 +17,16 @@ var FieldArrayEntry = Function.inherits('Alchemy.Element.Form.FieldEntry', funct
|
|
|
19
17
|
FieldArrayEntry.setTemplateFile('form/elements/alchemy_field_array_entry');
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
|
-
* Get a reference to the
|
|
20
|
+
* Get a reference to the al-field-array parent
|
|
23
21
|
*
|
|
24
22
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
25
23
|
* @since 0.1.0
|
|
26
|
-
* @version 0.
|
|
24
|
+
* @version 0.2.0
|
|
27
25
|
*/
|
|
28
26
|
FieldArrayEntry.enforceProperty(function alchemy_field_array(new_value, old_value) {
|
|
29
27
|
|
|
30
28
|
if (!new_value) {
|
|
31
|
-
new_value = this.queryUp('
|
|
29
|
+
new_value = this.queryUp('al-field-array');
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
return new_value;
|
|
@@ -39,7 +37,7 @@ FieldArrayEntry.enforceProperty(function alchemy_field_array(new_value, old_valu
|
|
|
39
37
|
*
|
|
40
38
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
41
39
|
* @since 0.1.3
|
|
42
|
-
* @version 0.
|
|
40
|
+
* @version 0.2.0
|
|
43
41
|
*/
|
|
44
42
|
FieldArrayEntry.setProperty(function index() {
|
|
45
43
|
|
|
@@ -59,7 +57,7 @@ FieldArrayEntry.setProperty(function index() {
|
|
|
59
57
|
for (let i = 0; i < container.entries_element.children.length; i++) {
|
|
60
58
|
child = container.entries_element.children[i];
|
|
61
59
|
|
|
62
|
-
if (child.tagName == '
|
|
60
|
+
if (child.tagName == 'AL-FIELD-ARRAY-ENTRY') {
|
|
63
61
|
counter++;
|
|
64
62
|
}
|
|
65
63
|
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The al-field-schema element
|
|
3
3
|
*
|
|
4
4
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.1.0
|
|
6
6
|
* @version 0.1.0
|
|
7
7
|
*/
|
|
8
|
-
var FieldSchema = Function.inherits('Alchemy.Element.Form.FieldCustom',
|
|
9
|
-
FieldSchema.super.call(this);
|
|
10
|
-
});
|
|
8
|
+
var FieldSchema = Function.inherits('Alchemy.Element.Form.FieldCustom', 'FieldSchema');
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* The template to use for the content of this element
|
|
@@ -23,7 +21,7 @@ FieldSchema.setTemplateFile('form/elements/alchemy_field_schema');
|
|
|
23
21
|
*
|
|
24
22
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
25
23
|
* @since 0.1.0
|
|
26
|
-
* @version 0.1.
|
|
24
|
+
* @version 0.1.12
|
|
27
25
|
*/
|
|
28
26
|
FieldSchema.setProperty(function schema() {
|
|
29
27
|
|
|
@@ -38,15 +36,29 @@ FieldSchema.setProperty(function schema() {
|
|
|
38
36
|
let values = other_field.config.options.values;
|
|
39
37
|
|
|
40
38
|
if (values) {
|
|
39
|
+
let value;
|
|
41
40
|
|
|
42
41
|
if (values instanceof Classes.Alchemy.Map.Backed) {
|
|
43
|
-
|
|
42
|
+
value = values.get(other_field.value);
|
|
44
43
|
} else {
|
|
45
|
-
|
|
44
|
+
value = values[other_field.value];
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
if (
|
|
49
|
-
|
|
47
|
+
if (value) {
|
|
48
|
+
if (value.schema) {
|
|
49
|
+
schema = value.schema;
|
|
50
|
+
} else if (value.value) {
|
|
51
|
+
// Enumified values can be wrapped on the server-side
|
|
52
|
+
value = value.value;
|
|
53
|
+
|
|
54
|
+
if (value.schema) {
|
|
55
|
+
schema = value.schema;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!schema) {
|
|
61
|
+
schema = value;
|
|
50
62
|
}
|
|
51
63
|
}
|
|
52
64
|
}
|
|
@@ -86,11 +98,11 @@ FieldSchema.setProperty(function sub_fields() {
|
|
|
86
98
|
*
|
|
87
99
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
88
100
|
* @since 0.1.0
|
|
89
|
-
* @version 0.
|
|
101
|
+
* @version 0.2.0
|
|
90
102
|
*/
|
|
91
103
|
FieldSchema.setProperty(function value() {
|
|
92
104
|
|
|
93
|
-
let entries = this.queryAllNotNested('
|
|
105
|
+
let entries = this.queryAllNotNested('al-field'),
|
|
94
106
|
result = {},
|
|
95
107
|
entry,
|
|
96
108
|
i;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The al-field-translatable element
|
|
3
3
|
*
|
|
4
4
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.1.0
|
|
6
6
|
* @version 0.1.0
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
FieldTranslatable.super.call(this);
|
|
10
|
-
});
|
|
8
|
+
const FieldTranslatable = Function.inherits('Alchemy.Element.Form.FieldCustom', 'FieldTranslatable');
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* The template to use for the content of this element
|
|
@@ -18,25 +16,16 @@ var FieldTranslatable = Function.inherits('Alchemy.Element.Form.FieldCustom', fu
|
|
|
18
16
|
*/
|
|
19
17
|
FieldTranslatable.setTemplateFile('form/elements/alchemy_field_translatable');
|
|
20
18
|
|
|
21
|
-
/**
|
|
22
|
-
* The stylesheet to load for this element
|
|
23
|
-
*
|
|
24
|
-
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
25
|
-
* @since 0.1.0
|
|
26
|
-
* @version 0.1.0
|
|
27
|
-
*/
|
|
28
|
-
FieldTranslatable.setStylesheetFile('form/alchemy_field_translatable');
|
|
29
|
-
|
|
30
19
|
/**
|
|
31
20
|
* Get the live value
|
|
32
21
|
*
|
|
33
22
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
34
23
|
* @since 0.1.0
|
|
35
|
-
* @version 0.
|
|
24
|
+
* @version 0.2.0
|
|
36
25
|
*/
|
|
37
26
|
FieldTranslatable.setProperty(function value() {
|
|
38
27
|
|
|
39
|
-
let entries = this.queryAllNotNested('
|
|
28
|
+
let entries = this.queryAllNotNested('al-field-translatable-entry'),
|
|
40
29
|
result = {},
|
|
41
30
|
entry,
|
|
42
31
|
i;
|
|
@@ -58,12 +47,12 @@ FieldTranslatable.setProperty(function value() {
|
|
|
58
47
|
*
|
|
59
48
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
60
49
|
* @since 0.1.0
|
|
61
|
-
* @version 0.
|
|
50
|
+
* @version 0.2.0
|
|
62
51
|
*/
|
|
63
52
|
FieldTranslatable.setMethod(function showPrefix(prefix) {
|
|
64
53
|
|
|
65
54
|
let buttons = this.queryAllNotNested('.prefix-buttons button'),
|
|
66
|
-
entries = this.queryAllNotNested('
|
|
55
|
+
entries = this.queryAllNotNested('al-field-translatable-entry'),
|
|
67
56
|
element,
|
|
68
57
|
i;
|
|
69
58
|
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The al-field-translatable-entry element
|
|
3
3
|
*
|
|
4
4
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.1.0
|
|
6
6
|
* @version 0.1.0
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
FieldTranslatableEntry.super.call(this);
|
|
10
|
-
});
|
|
8
|
+
const FieldTranslatableEntry = Function.inherits('Alchemy.Element.Form.FieldEntry', 'FieldTranslatableEntry');
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* The template to use for the content of this element
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The al-form element
|
|
3
3
|
*
|
|
4
4
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.1.0
|
|
6
6
|
* @version 0.1.0
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The stylesheet to load for this element
|
|
12
|
-
*
|
|
13
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
14
|
-
* @since 0.1.0
|
|
15
|
-
* @version 0.1.0
|
|
16
|
-
*/
|
|
17
|
-
Form.setStylesheetFile('form/alchemy_form');
|
|
8
|
+
const Form = Function.inherits('Alchemy.Element.Form.Base', 'Form');
|
|
18
9
|
|
|
19
10
|
/**
|
|
20
11
|
* The attribute to use for the route
|
|
@@ -97,11 +88,11 @@ Form.setProperty(function main_error_area() {
|
|
|
97
88
|
*
|
|
98
89
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
99
90
|
* @since 0.1.0
|
|
100
|
-
* @version 0.
|
|
91
|
+
* @version 0.2.0
|
|
101
92
|
*/
|
|
102
93
|
Form.setProperty(function value() {
|
|
103
94
|
|
|
104
|
-
let fields = this.queryAllNotNested('
|
|
95
|
+
let fields = this.queryAllNotNested('al-field'),
|
|
105
96
|
result = {},
|
|
106
97
|
field,
|
|
107
98
|
key,
|
|
@@ -282,7 +273,7 @@ Form.setMethod(async function showViolations(err) {
|
|
|
282
273
|
*
|
|
283
274
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
284
275
|
* @since 0.1.0
|
|
285
|
-
* @version 0.
|
|
276
|
+
* @version 0.2.0
|
|
286
277
|
*
|
|
287
278
|
* @param {String} path
|
|
288
279
|
*
|
|
@@ -304,9 +295,9 @@ Form.setMethod(function findFieldByPath(path) {
|
|
|
304
295
|
}
|
|
305
296
|
|
|
306
297
|
if (current.config && current.config.is_array) {
|
|
307
|
-
query = '
|
|
298
|
+
query = 'al-field-array-entry:nth-child(' + (Number(piece) + 1) + ') .field > *';
|
|
308
299
|
} else {
|
|
309
|
-
query = '
|
|
300
|
+
query = 'al-field[field-name="' + piece + '"]';
|
|
310
301
|
}
|
|
311
302
|
|
|
312
303
|
current = current.queryAllNotNested(query)[0];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The al-label custom element
|
|
3
3
|
*
|
|
4
4
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.1.0
|
|
@@ -7,15 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
const AlchemyLabel = Function.inherits('Alchemy.Element.Form.Base', 'Label');
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* The stylesheet to load for this element
|
|
12
|
-
*
|
|
13
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
14
|
-
* @since 0.1.0
|
|
15
|
-
* @version 0.1.0
|
|
16
|
-
*/
|
|
17
|
-
AlchemyLabel.setStylesheetFile('form/alchemy_form');
|
|
18
|
-
|
|
19
10
|
/**
|
|
20
11
|
* The linked element
|
|
21
12
|
*
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The al-number-input custom element
|
|
3
3
|
*
|
|
4
4
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.1.3
|
|
6
6
|
* @version 0.1.3
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
const NumberInput = Function.inherits('Alchemy.Element.Form.FeedbackInput', 'NumberInput');
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* The hawkejs template to use
|