@kerkhoff-ict/solora 2.0.8 → 2.1.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.
- package/dist/index.css +5 -3
- package/dist/index.js +7 -5
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -474,12 +474,14 @@
|
|
|
474
474
|
min-width: 10rem;
|
|
475
475
|
border-radius: 12px;
|
|
476
476
|
margin-top: 0.5rem;
|
|
477
|
-
|
|
477
|
+
overflow: hidden;
|
|
478
|
+
overflow-y: auto;
|
|
479
|
+
background: rgba(255, 255, 255, 0);
|
|
480
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
478
481
|
backdrop-filter: blur(12px);
|
|
479
482
|
-webkit-backdrop-filter: blur(12px);
|
|
480
|
-
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.
|
|
483
|
+
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
|
|
481
484
|
max-height: 15rem;
|
|
482
|
-
overflow-y: auto;
|
|
483
485
|
scrollbar-width: thin;
|
|
484
486
|
scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
|
|
485
487
|
opacity: 0;
|
package/dist/index.js
CHANGED
|
@@ -1870,18 +1870,20 @@ function initDropdowns() {
|
|
|
1870
1870
|
};
|
|
1871
1871
|
const initialItem = content.querySelector(".dropdown-item.active") || content.querySelector('.dropdown-item:not([aria-disabled="true"])');
|
|
1872
1872
|
if (initialItem) setValue(initialItem);
|
|
1873
|
+
const openDropdown = () => drop.classList.add("open");
|
|
1874
|
+
const closeDropdown = () => drop.classList.remove("open");
|
|
1873
1875
|
btn.addEventListener("click", (e) => {
|
|
1874
1876
|
if (drop.getAttribute("aria-disabled") === "true") return;
|
|
1875
1877
|
e.stopPropagation();
|
|
1876
1878
|
drop.classList.toggle("open");
|
|
1877
1879
|
});
|
|
1878
1880
|
document.addEventListener("click", (e) => {
|
|
1879
|
-
if (!drop.contains(e.target))
|
|
1881
|
+
if (!drop.contains(e.target)) closeDropdown();
|
|
1880
1882
|
});
|
|
1881
1883
|
content.querySelectorAll(".dropdown-item").forEach((item) => {
|
|
1882
1884
|
item.addEventListener("click", () => {
|
|
1883
1885
|
setValue(item);
|
|
1884
|
-
|
|
1886
|
+
closeDropdown();
|
|
1885
1887
|
});
|
|
1886
1888
|
});
|
|
1887
1889
|
let items = Array.from(content.querySelectorAll('.dropdown-item:not([aria-disabled="true"])'));
|
|
@@ -1890,7 +1892,7 @@ function initDropdowns() {
|
|
|
1890
1892
|
if (drop.getAttribute("aria-disabled") === "true") return;
|
|
1891
1893
|
if (!["ArrowDown", "ArrowUp", "Enter", "Escape"].includes(e.key)) return;
|
|
1892
1894
|
e.preventDefault();
|
|
1893
|
-
|
|
1895
|
+
openDropdown();
|
|
1894
1896
|
if (e.key === "ArrowDown") {
|
|
1895
1897
|
index = (index + 1) % items.length;
|
|
1896
1898
|
items.forEach((i) => i.classList.remove("active"));
|
|
@@ -1905,10 +1907,10 @@ function initDropdowns() {
|
|
|
1905
1907
|
}
|
|
1906
1908
|
if (e.key === "Enter") {
|
|
1907
1909
|
setValue(items[index]);
|
|
1908
|
-
|
|
1910
|
+
closeDropdown();
|
|
1909
1911
|
}
|
|
1910
1912
|
if (e.key === "Escape") {
|
|
1911
|
-
|
|
1913
|
+
closeDropdown();
|
|
1912
1914
|
}
|
|
1913
1915
|
});
|
|
1914
1916
|
btn.setAttribute("tabindex", "0");
|