alchemy-form 0.1.9 → 0.1.10

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 CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.1.10 (2022-07-14)
2
+
3
+ * Hide `code-input` contents until it's fully loaded
4
+ * Don't crash when failing to get a field definition in a table
5
+
1
6
  ## 0.1.9 (2022-07-06)
2
7
 
3
8
  * Allow supplying a custom `data-src` to `alchemy-field` elements
@@ -86,7 +86,7 @@ FieldArray.setMethod(function introduced() {
86
86
  let view_files = alchemy_field.view_files;
87
87
 
88
88
  if (!view_files || !view_files.length) {
89
- throw new Error('Unable to add new entry for ' + alchemy_field.field_title);
89
+ throw new Error('Unable to add new entry for field "' + alchemy_field.field_title + '", no view files found');
90
90
  }
91
91
 
92
92
  let new_entry = that.createElement('alchemy-field-array-entry');
@@ -594,7 +594,7 @@ Table.setMethod(function showPagination() {
594
594
  *
595
595
  * @author Jelle De Loecker <jelle@elevenways.be>
596
596
  * @since 0.1.8
597
- * @version 0.1.8
597
+ * @version 0.1.10
598
598
  *
599
599
  * @param {FieldConfig} field_config The config on how to display the field
600
600
  * @param {Object} container The container where the field should be in
@@ -604,7 +604,13 @@ Table.setMethod(function showPagination() {
604
604
  Table.setMethod(function getFieldConfigView(field_config, container) {
605
605
 
606
606
  let value = field_config.getValueIn(container),
607
- field = field_config.getFieldDefinition();
607
+ field;
608
+
609
+ try {
610
+ field = field_config.getFieldDefinition();
611
+ } catch (err) {
612
+ console.error('Failed to get field definition:', err);
613
+ }
608
614
 
609
615
  if (value == null && !field) {
610
616
  return null;
@@ -67,7 +67,7 @@ CodeInput.setProperty(function value(value) {
67
67
  *
68
68
  * @author Jelle De Loecker <jelle@elevenways.be>
69
69
  * @since 0.1.0
70
- * @version 0.1.0
70
+ * @version 0.1.10
71
71
  */
72
72
  CodeInput.setMethod(async function introduced() {
73
73
 
@@ -75,6 +75,8 @@ CodeInput.setMethod(async function introduced() {
75
75
 
76
76
  let editor_el = this.querySelector('.code-editor');
77
77
 
78
+ editor_el.hidden = false;
79
+
78
80
  let editor = ace.edit(editor_el);
79
81
 
80
82
  editor.session.setUseWrapMode(true);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "alchemy-form",
3
3
  "description": "Form plugin for Alchemy",
4
- "version": "0.1.9",
4
+ "version": "0.1.10",
5
5
  "repository": {
6
6
  "type" : "git",
7
7
  "url" : "https://github.com/11ways/alchemy-form.git"
@@ -1 +1 @@
1
- <div class="code-editor"><% Blast.Classes.Hawkejs.replaceChildren($0, child_nodes) %></div>
1
+ <div class="code-editor" hidden><% Blast.Classes.Hawkejs.replaceChildren($0, child_nodes) %></div>