@websy/websy-designs 1.11.11 → 1.11.12
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.
|
@@ -2087,7 +2087,12 @@ class WebsyDropdown {
|
|
|
2087
2087
|
labelEl.innerHTML = item.label
|
|
2088
2088
|
labelEl.setAttribute('data-info', item.label)
|
|
2089
2089
|
inputEl.value = item.value
|
|
2090
|
-
}
|
|
2090
|
+
}
|
|
2091
|
+
else if (this.selectedItems[0]) {
|
|
2092
|
+
labelEl.innerHTML = dataToUse[this.selectedItems[0]].label
|
|
2093
|
+
labelEl.setAttribute('data-info', dataToUse[this.selectedItems[0]].label)
|
|
2094
|
+
inputEl.value = dataToUse[this.selectedItems[0]].value
|
|
2095
|
+
}
|
|
2091
2096
|
}
|
|
2092
2097
|
else if (this.selectedItems.length > 1) {
|
|
2093
2098
|
if (this.options.showCompleteSelectedList === true) {
|
|
@@ -2116,10 +2121,12 @@ class WebsyDropdown {
|
|
|
2116
2121
|
if (this.options.onSearch) {
|
|
2117
2122
|
dataToUse = this.options.items
|
|
2118
2123
|
}
|
|
2124
|
+
let item
|
|
2119
2125
|
if (typeof index !== 'undefined' && index !== null) {
|
|
2120
2126
|
let pos = this.selectedItems.indexOf(index)
|
|
2121
2127
|
if (this.options.multiSelect === false) {
|
|
2122
2128
|
this.selectedItems = [index]
|
|
2129
|
+
item = dataToUse[index]
|
|
2123
2130
|
}
|
|
2124
2131
|
else {
|
|
2125
2132
|
if (pos !== -1) {
|
|
@@ -2127,11 +2134,10 @@ class WebsyDropdown {
|
|
|
2127
2134
|
}
|
|
2128
2135
|
else {
|
|
2129
2136
|
this.selectedItems.push(index)
|
|
2137
|
+
item = dataToUse[index]
|
|
2130
2138
|
}
|
|
2131
2139
|
}
|
|
2132
|
-
}
|
|
2133
|
-
// const item = this.options.items[index]
|
|
2134
|
-
const item = dataToUse[index]
|
|
2140
|
+
}
|
|
2135
2141
|
this.updateHeader(item)
|
|
2136
2142
|
if (item && this.options.onItemSelected) {
|
|
2137
2143
|
this.options.onItemSelected(item, this.selectedItems, dataToUse, this.options)
|
|
@@ -2069,6 +2069,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
2069
2069
|
labelEl.innerHTML = item.label;
|
|
2070
2070
|
labelEl.setAttribute('data-info', item.label);
|
|
2071
2071
|
inputEl.value = item.value;
|
|
2072
|
+
} else if (this.selectedItems[0]) {
|
|
2073
|
+
labelEl.innerHTML = dataToUse[this.selectedItems[0]].label;
|
|
2074
|
+
labelEl.setAttribute('data-info', dataToUse[this.selectedItems[0]].label);
|
|
2075
|
+
inputEl.value = dataToUse[this.selectedItems[0]].value;
|
|
2072
2076
|
}
|
|
2073
2077
|
} else if (this.selectedItems.length > 1) {
|
|
2074
2078
|
if (this.options.showCompleteSelectedList === true) {
|
|
@@ -2103,20 +2107,21 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
2103
2107
|
if (this.options.onSearch) {
|
|
2104
2108
|
dataToUse = this.options.items;
|
|
2105
2109
|
}
|
|
2110
|
+
var item;
|
|
2106
2111
|
if (typeof index !== 'undefined' && index !== null) {
|
|
2107
2112
|
var pos = this.selectedItems.indexOf(index);
|
|
2108
2113
|
if (this.options.multiSelect === false) {
|
|
2109
2114
|
this.selectedItems = [index];
|
|
2115
|
+
item = dataToUse[index];
|
|
2110
2116
|
} else {
|
|
2111
2117
|
if (pos !== -1) {
|
|
2112
2118
|
this.selectedItems.splice(pos, 1);
|
|
2113
2119
|
} else {
|
|
2114
2120
|
this.selectedItems.push(index);
|
|
2121
|
+
item = dataToUse[index];
|
|
2115
2122
|
}
|
|
2116
2123
|
}
|
|
2117
2124
|
}
|
|
2118
|
-
// const item = this.options.items[index]
|
|
2119
|
-
var item = dataToUse[index];
|
|
2120
2125
|
this.updateHeader(item);
|
|
2121
2126
|
if (item && this.options.onItemSelected) {
|
|
2122
2127
|
this.options.onItemSelected(item, this.selectedItems, dataToUse, this.options);
|