@ccrpc/webmapgl 0.18.2 → 0.18.4

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.
@@ -42,7 +42,8 @@ const Field = class {
42
42
  this.message = undefined;
43
43
  this.attribute = undefined;
44
44
  this.image = undefined;
45
- this.label = undefined;
45
+ this.label = "";
46
+ this.placeholder = "";
46
47
  this.required = false;
47
48
  this.type = undefined;
48
49
  this.widget = undefined;
@@ -94,10 +95,13 @@ const Field = class {
94
95
  return (h("ion-item", null, h("ion-label", null, this.label), ",", h("ion-select", { onIonChange: this.onChange, value: this.getValue() }, h("slot", null))));
95
96
  }
96
97
  getTextareaField() {
97
- return (h("ion-item", null, h("ion-label", { "text-wrap": true, position: "floating" }, this.label), h("ion-textarea", { onIonInput: this.onInput, value: this._getValue() || "", legacy: true })));
98
+ return (h("ion-item", null, this.label !== "" ? (h("ion-label", { "text-wrap": true, position: "floating" }, this.label)) : (""), h("ion-textarea", { onIonInput: this.onInput, placeholder: this.placeholder, value: this._getValue() || "", legacy: true })));
99
+ }
100
+ getInstructionsField() {
101
+ return (h("ion-item", null, h("ion-textarea", { readonly: true, value: this.label })));
98
102
  }
99
103
  getInputField() {
100
- return (h("ion-item", null, h("ion-label", { "text-wrap": true, position: "floating" }, this.label), h("ion-input", { onIonInput: this.onInput, type: "text", value: this._getValue() })));
104
+ return (h("ion-item", null, h("ion-label", { "text-wrap": true, position: "floating" }, this.label), h("ion-input", { onIonInput: this.onInput, type: "text", placeholder: this.placeholder, value: this._getValue() })));
101
105
  }
102
106
  render() {
103
107
  if (this.widget === "radio") {
@@ -109,6 +113,9 @@ const Field = class {
109
113
  else if (this.widget == "textarea") {
110
114
  return this.getTextareaField();
111
115
  }
116
+ else if (this.widget == "instructions") {
117
+ return this.getInstructionsField();
118
+ }
112
119
  else {
113
120
  return this.getInputField();
114
121
  }
@@ -163,7 +170,7 @@ const FormPage = class {
163
170
  return this.facets.map((facet) => (h("gl-facet", { label: facet.label, value: facet.value, image: facet.image, widget: facet.widget })));
164
171
  }
165
172
  renderFields() {
166
- return this.fields.map((field) => (h("gl-field", { attribute: field.attribute, label: field.label, image: field.image, required: field.required, type: field.type, widget: field.widget }, this.renderOptions(field.options))));
173
+ return this.fields.map((field) => (h("gl-field", { attribute: field.attribute, label: field.label, image: field.image, required: field.required, type: field.type, widget: field.widget, placeholder: field.placeholder }, this.renderOptions(field.options))));
167
174
  }
168
175
  renderOptions(options) {
169
176
  if (options == undefined)