Skip to content

Commit 662a11f

Browse files
committed
update docs
1 parent a4f831c commit 662a11f

File tree

6 files changed

+36
-15
lines changed

6 files changed

+36
-15
lines changed

docs/index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<!DOCTYPE html>
21
<html lang="en" data-bs-theme="light">
32
<head>
43
<meta charset="utf-8" />
@@ -37,7 +36,7 @@
3736
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h360c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H184V184h656v320c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V144c0-17.7-14.3-32-32-32zM653.3 599.4l52.2-52.2a8.01 8.01 0 0 0-4.7-13.6l-179.4-21c-5.1-.6-9.5 3.7-8.9 8.9l21 179.4c.8 6.6 8.9 9.4 13.6 4.7l52.4-52.4 256.2 256.2c3.1 3.1 8.2 3.1 11.3 0l42.4-42.4c3.1-3.1 3.1-8.2 0-11.3L653.3 599.4z"></path></svg>
3837
use-bootstrap-select
3938
</a>
40-
<small class="small">v1.0.1</small>
39+
<small class="small">v1.1.0</small>
4140
<div class="ms-auto d-flex align-items-center gap-3">
4241
<a class="fs-5 link-body-emphasis" href="https://github.com/use-bootstrap/use-bootstrap-select" target="_blank">
4342
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg>
@@ -122,7 +121,7 @@ <h2 class="fw-bold">Installation</h2>
122121
&lt;meta charset=&quot;utf-8&quot;&gt;
123122
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
124123
&lt;title&gt;Use Bootstrap Select Demo&lt;/title&gt;
125-
&lt;link href=&quot;https://unpkg.com/bootstrap@5.3.1/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;
124+
&lt;link href=&quot;https://unpkg.com/bootstrap@5.3.3/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;
126125
&lt;link href=&quot;node_modules/use-bootstrap-select/dist/use-bootstrap-select.min.css&quot; rel=&quot;stylesheet&quot;&gt;
127126
&lt;/head&gt;
128127
&lt;body&gt;
@@ -134,7 +133,7 @@ <h2 class="fw-bold">Installation</h2>
134133
&lt;option value=&quot;opera&quot;&gt;Opera&lt;/option&gt;
135134
&lt;option value=&quot;safari&quot;&gt;Safari&lt;/option&gt;
136135
&lt;/select&gt;
137-
&lt;script src=&quot;https://unpkg.com/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;
136+
&lt;script src=&quot;https://unpkg.com/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;
138137
&lt;script src=&quot;node_modules/use-bootstrap-select/dist/use-bootstrap-select.min.js&quot;&gt;&lt;/script&gt;
139138
&lt;/body&gt;
140139
&lt;/html&gt;

docs/use-bootstrap-select.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/use-bootstrap-select.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
(() => {
22
// src/use-bootstrap-select.ts
33
function UseBootstrapSelect(target, bootstrapInstance) {
4-
const { ubSelectClear, ubSelectSearch, ubSelectCreate, ubSelectMaxHeight } = target.dataset;
4+
const {
5+
ubSelectClear,
6+
ubSelectSearch,
7+
ubSelectCreate,
8+
ubSelectMaxHeight,
9+
ubSelectSearchPlaceholder,
10+
ubSelectNoResultsText,
11+
ubSelectCreatableText
12+
} = target.dataset;
513
const isClear = ubSelectClear !== void 0;
614
const isSearch = ubSelectSearch !== void 0;
715
const isCreate = ubSelectCreate !== void 0;
816
const maxHeight = ubSelectMaxHeight || "25rem";
17+
const searchPlaceholder = ubSelectSearchPlaceholder || "Search";
18+
const noResultsText = ubSelectNoResultsText || "No results found";
19+
const creatableText = ubSelectCreatableText || "Press Enter to add {value}";
920
const isMultiple = target.multiple;
1021
const isDisabled = target.disabled;
1122
const classDropdown = "use-bootstrap-select";
@@ -72,7 +83,7 @@
7283
searchInput = createElement("input", {
7384
type: "text",
7485
className: classSearchInput,
75-
placeholder: "Search"
86+
placeholder: searchPlaceholder
7687
});
7788
target.classList.contains("form-select-sm") && searchInput.classList.add("form-control-sm");
7889
target.classList.contains("form-select-lg") && searchInput.classList.add("form-control-lg");
@@ -81,7 +92,7 @@
8192
div.append(searchInput);
8293
dropdownMenu.prepend(div);
8394
searchNoResults = createElement("div", {
84-
textContent: "No results found",
95+
textContent: noResultsText,
8596
className: classHidden
8697
});
8798
searchNoResults.style.padding = paddingDropdownItem;
@@ -244,7 +255,7 @@
244255
} else {
245256
searchNoResults.classList.remove(classHidden);
246257
if (isCreate) {
247-
searchNoResults.innerHTML = `Press Enter to add "<b>${value}</b>"`;
258+
searchNoResults.innerHTML = creatableText.replace("{value}", `<b>${value}</b>`);
248259
if (e.key === "Enter") {
249260
const newOption = createElement("option", {
250261
value,

docs/use-bootstrap-select.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)