@danielgindi/selectbox 2.0.55 → 2.0.57
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/dist/lib.cjs.js +17 -4
- package/dist/lib.cjs.js.map +1 -1
- package/dist/lib.cjs.min.js +2 -2
- package/dist/lib.cjs.min.js.map +1 -1
- package/dist/lib.es6.js +17 -4
- package/dist/lib.es6.js.map +1 -1
- package/dist/lib.es6.min.js +2 -2
- package/dist/lib.es6.min.js.map +1 -1
- package/dist/lib.umd.js +17 -4
- package/dist/lib.umd.js.map +1 -1
- package/dist/lib.umd.min.js +2 -2
- package/dist/lib.umd.min.js.map +1 -1
- package/lib/DropList.js +23 -2
- package/package.json +1 -1
- package/vue/DropList.vue +62 -51
package/dist/lib.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @danielgindi/selectbox 2.0.
|
|
2
|
+
* @danielgindi/selectbox 2.0.57
|
|
3
3
|
* git://github.com/danielgindi/selectbox.git
|
|
4
4
|
*/
|
|
5
5
|
(function(global, factory) {
|
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
* @property {boolean} [isHeaderVisible=false] show header element
|
|
118
118
|
* @property {boolean} [isFooterVisible=false] show footer element
|
|
119
119
|
* @property {boolean} [searchable=false] include inline search box
|
|
120
|
+
* @property {string} [searchPlaceholder=''] placeholder text for the inline search box
|
|
120
121
|
* @property {string} [noResultsText='No matching results'] text for no results (empty for none)
|
|
121
122
|
* @property {number} [filterThrottleWindow=300] throttle time (milliseconds) for filtering
|
|
122
123
|
* @property {boolean} [filterOnEmptyTerm=false] call the filter function on empty search term too
|
|
@@ -181,6 +182,7 @@
|
|
|
181
182
|
isHeaderVisible: false,
|
|
182
183
|
isFooterVisible: false,
|
|
183
184
|
searchable: false,
|
|
185
|
+
searchPlaceholder: "",
|
|
184
186
|
noResultsText: "No matching results",
|
|
185
187
|
filterThrottleWindow: 300,
|
|
186
188
|
filterOnEmptyTerm: false,
|
|
@@ -225,6 +227,7 @@
|
|
|
225
227
|
on: o.on || null,
|
|
226
228
|
positionOptionsProvider: o.positionOptionsProvider ?? null,
|
|
227
229
|
searchable: o.searchable,
|
|
230
|
+
searchPlaceholder: o.searchPlaceholder,
|
|
228
231
|
isHeaderVisible: o.isHeaderVisible,
|
|
229
232
|
isFooterVisible: o.isFooterVisible,
|
|
230
233
|
silenceEvents: true,
|
|
@@ -1406,7 +1409,8 @@
|
|
|
1406
1409
|
autocomplete: "off",
|
|
1407
1410
|
autocapitalize: "off",
|
|
1408
1411
|
spellcheck: "false",
|
|
1409
|
-
"aria-autocomplete": "list"
|
|
1412
|
+
"aria-autocomplete": "list",
|
|
1413
|
+
placeholder: p.searchPlaceholder || ""
|
|
1410
1414
|
});
|
|
1411
1415
|
p.headerEl.appendChild(p.searchInput);
|
|
1412
1416
|
} else {
|
|
@@ -1415,6 +1419,15 @@
|
|
|
1415
1419
|
}
|
|
1416
1420
|
this.setHeaderVisible(searchable);
|
|
1417
1421
|
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Set the placeholder text of the inline search box
|
|
1424
|
+
* @param {string} placeholder
|
|
1425
|
+
*/
|
|
1426
|
+
setSearchPlaceholder(placeholder) {
|
|
1427
|
+
const p = this._p;
|
|
1428
|
+
p.searchPlaceholder = placeholder || "";
|
|
1429
|
+
if (p.searchInput) p.searchInput.placeholder = p.searchPlaceholder;
|
|
1430
|
+
}
|
|
1418
1431
|
hasFocusedItem() {
|
|
1419
1432
|
return this._p.focusItemIndex > -1 && this._p.focusItemIndex < this._p.items.length;
|
|
1420
1433
|
}
|
|
@@ -2222,8 +2235,8 @@
|
|
|
2222
2235
|
let newOuterWidth = Math.max(autoWidth, targetWidth);
|
|
2223
2236
|
(0, _danielgindi_dom_utils_lib_Css.setElementWidth)(el, newOuterWidth, true, true);
|
|
2224
2237
|
const elComputedStyle = getComputedStyle(el);
|
|
2225
|
-
let
|
|
2226
|
-
let scrollWidth = el.scrollWidth +
|
|
2238
|
+
let extraElWidth = (parseFloat(elComputedStyle.borderLeftWidth) || 0) + (parseFloat(elComputedStyle.borderRightWidth) || 0) + (parseFloat(elComputedStyle.paddingLeft) || 0) + (parseFloat(elComputedStyle.paddingRight) || 0);
|
|
2239
|
+
let scrollWidth = el.scrollWidth + extraElWidth;
|
|
2227
2240
|
if (scrollWidth > newOuterWidth) {
|
|
2228
2241
|
let delta = scrollWidth - newOuterWidth;
|
|
2229
2242
|
el.style.width = `${parseFloat(el.style.width) + delta}px`;
|