@danielgindi/selectbox 2.0.56 → 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 +15 -2
- 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 +15 -2
- 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 +15 -2
- 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 +18 -0
- package/package.json +1 -1
- package/vue/DropList.vue +62 -51
package/dist/lib.cjs.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
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
@@ -112,6 +112,7 @@ var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
112
112
|
* @property {boolean} [isHeaderVisible=false] show header element
|
|
113
113
|
* @property {boolean} [isFooterVisible=false] show footer element
|
|
114
114
|
* @property {boolean} [searchable=false] include inline search box
|
|
115
|
+
* @property {string} [searchPlaceholder=''] placeholder text for the inline search box
|
|
115
116
|
* @property {string} [noResultsText='No matching results'] text for no results (empty for none)
|
|
116
117
|
* @property {number} [filterThrottleWindow=300] throttle time (milliseconds) for filtering
|
|
117
118
|
* @property {boolean} [filterOnEmptyTerm=false] call the filter function on empty search term too
|
|
@@ -176,6 +177,7 @@ var DefaultOptions = {
|
|
|
176
177
|
isHeaderVisible: false,
|
|
177
178
|
isFooterVisible: false,
|
|
178
179
|
searchable: false,
|
|
180
|
+
searchPlaceholder: "",
|
|
179
181
|
noResultsText: "No matching results",
|
|
180
182
|
filterThrottleWindow: 300,
|
|
181
183
|
filterOnEmptyTerm: false,
|
|
@@ -220,6 +222,7 @@ var DropList = class DropList {
|
|
|
220
222
|
on: o.on || null,
|
|
221
223
|
positionOptionsProvider: o.positionOptionsProvider ?? null,
|
|
222
224
|
searchable: o.searchable,
|
|
225
|
+
searchPlaceholder: o.searchPlaceholder,
|
|
223
226
|
isHeaderVisible: o.isHeaderVisible,
|
|
224
227
|
isFooterVisible: o.isFooterVisible,
|
|
225
228
|
silenceEvents: true,
|
|
@@ -1401,7 +1404,8 @@ var DropList = class DropList {
|
|
|
1401
1404
|
autocomplete: "off",
|
|
1402
1405
|
autocapitalize: "off",
|
|
1403
1406
|
spellcheck: "false",
|
|
1404
|
-
"aria-autocomplete": "list"
|
|
1407
|
+
"aria-autocomplete": "list",
|
|
1408
|
+
placeholder: p.searchPlaceholder || ""
|
|
1405
1409
|
});
|
|
1406
1410
|
p.headerEl.appendChild(p.searchInput);
|
|
1407
1411
|
} else {
|
|
@@ -1410,6 +1414,15 @@ var DropList = class DropList {
|
|
|
1410
1414
|
}
|
|
1411
1415
|
this.setHeaderVisible(searchable);
|
|
1412
1416
|
}
|
|
1417
|
+
/**
|
|
1418
|
+
* Set the placeholder text of the inline search box
|
|
1419
|
+
* @param {string} placeholder
|
|
1420
|
+
*/
|
|
1421
|
+
setSearchPlaceholder(placeholder) {
|
|
1422
|
+
const p = this._p;
|
|
1423
|
+
p.searchPlaceholder = placeholder || "";
|
|
1424
|
+
if (p.searchInput) p.searchInput.placeholder = p.searchPlaceholder;
|
|
1425
|
+
}
|
|
1413
1426
|
hasFocusedItem() {
|
|
1414
1427
|
return this._p.focusItemIndex > -1 && this._p.focusItemIndex < this._p.items.length;
|
|
1415
1428
|
}
|