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.
Files changed (2) hide show
  1. package/input-provider.js +11 -6
  2. 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 optionElements = options
138
- .split(',')
139
- .map((option) => {
140
- if (option === placeholder) {
141
- return `<option value="" selected class="select-default-option">${option}</option>`;
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="${option}">${option}</option>`;
148
+ return `<option value="${optionValue}">${optionName}</option>`;
144
149
  })
145
150
  .join('');
146
151
  this.inputElement.innerHTML = optionElements;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {