saasufy-components 5.6.0 → 5.7.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/input-provider.js +11 -6
- package/package.json +1 -1
package/input-provider.js
CHANGED
|
@@ -134,13 +134,18 @@ class InputProvider extends HTMLElement {
|
|
|
134
134
|
this.inputElement = document.createElement(elementType);
|
|
135
135
|
if (type === 'select') {
|
|
136
136
|
if (options) {
|
|
137
|
-
let
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
let {
|
|
138
|
+
fieldNames: optionNames,
|
|
139
|
+
fieldValues: optionValues
|
|
140
|
+
} = convertStringToFieldParams(options);
|
|
141
|
+
|
|
142
|
+
let optionElements = optionNames
|
|
143
|
+
.map((optionName) => {
|
|
144
|
+
let optionValue = optionValues[optionName] || optionName;
|
|
145
|
+
if (optionName === placeholder) {
|
|
146
|
+
return `<option value="" selected class="select-default-option">${optionName}</option>`;
|
|
142
147
|
}
|
|
143
|
-
return `<option value="${
|
|
148
|
+
return `<option value="${optionValue}">${optionName}</option>`;
|
|
144
149
|
})
|
|
145
150
|
.join('');
|
|
146
151
|
this.inputElement.innerHTML = optionElements;
|