@kerkhoff-ict/solora 2.5.3 → 2.5.4
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 +38 -2
- package/dist/index.js +24 -8
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -798,8 +798,6 @@
|
|
|
798
798
|
}
|
|
799
799
|
.popover-content {
|
|
800
800
|
position: absolute;
|
|
801
|
-
top: 100%;
|
|
802
|
-
left: 0;
|
|
803
801
|
min-width: 10rem;
|
|
804
802
|
border-radius: 12px;
|
|
805
803
|
margin-top: 0.5rem;
|
|
@@ -818,6 +816,44 @@
|
|
|
818
816
|
padding: 0.5rem;
|
|
819
817
|
color: var(--color-text-dark, #000);
|
|
820
818
|
}
|
|
819
|
+
.popover.top-left .popover-content {
|
|
820
|
+
bottom: 100%;
|
|
821
|
+
left: 0;
|
|
822
|
+
}
|
|
823
|
+
.popover.top-center .popover-content {
|
|
824
|
+
bottom: 100%;
|
|
825
|
+
left: 50%;
|
|
826
|
+
transform: translateX(-50%);
|
|
827
|
+
}
|
|
828
|
+
.popover.top-right .popover-content {
|
|
829
|
+
bottom: 100%;
|
|
830
|
+
right: 0;
|
|
831
|
+
}
|
|
832
|
+
.popover.bottom-left .popover-content {
|
|
833
|
+
top: 100%;
|
|
834
|
+
left: 0;
|
|
835
|
+
}
|
|
836
|
+
.popover.bottom-center .popover-content {
|
|
837
|
+
top: 100%;
|
|
838
|
+
left: 50%;
|
|
839
|
+
transform: translateX(-50%);
|
|
840
|
+
}
|
|
841
|
+
.popover.bottom-right .popover-content {
|
|
842
|
+
top: 100%;
|
|
843
|
+
right: 0;
|
|
844
|
+
}
|
|
845
|
+
.popover.left .popover-content {
|
|
846
|
+
right: 100%;
|
|
847
|
+
top: 50%;
|
|
848
|
+
transform: translateY(-50%);
|
|
849
|
+
margin: 0 0.5rem;
|
|
850
|
+
}
|
|
851
|
+
.popover.right .popover-content {
|
|
852
|
+
left: 100%;
|
|
853
|
+
top: 50%;
|
|
854
|
+
transform: translateY(-50%);
|
|
855
|
+
margin: 0 0.5rem;
|
|
856
|
+
}
|
|
821
857
|
.popover.sol-pop-w-16 {
|
|
822
858
|
width: 4rem;
|
|
823
859
|
}
|
package/dist/index.js
CHANGED
|
@@ -2323,22 +2323,38 @@ function initThemeToggle(elementSelector = ".sol-theme-toggle") {
|
|
|
2323
2323
|
// src/components/popover.js
|
|
2324
2324
|
function initPopovers() {
|
|
2325
2325
|
if (typeof window === "undefined") return;
|
|
2326
|
-
document.querySelectorAll(".popover")
|
|
2326
|
+
const allPopovers = document.querySelectorAll(".popover");
|
|
2327
|
+
allPopovers.forEach((pop) => {
|
|
2327
2328
|
if (pop.dataset.initialized) return;
|
|
2328
2329
|
pop.dataset.initialized = "true";
|
|
2329
2330
|
const content = pop.querySelector(".popover-content");
|
|
2330
2331
|
if (!content) return;
|
|
2331
|
-
const
|
|
2332
|
-
|
|
2333
|
-
|
|
2332
|
+
const closeAllOthers = () => {
|
|
2333
|
+
allPopovers.forEach((p) => {
|
|
2334
|
+
if (p !== pop) p.classList.remove("open");
|
|
2335
|
+
});
|
|
2336
|
+
};
|
|
2337
|
+
const toggle = (e) => {
|
|
2334
2338
|
e.stopPropagation();
|
|
2335
|
-
|
|
2336
|
-
|
|
2339
|
+
const isOpen = pop.classList.contains("open");
|
|
2340
|
+
closeAllOthers();
|
|
2341
|
+
if (!isOpen) {
|
|
2342
|
+
pop.classList.add("open");
|
|
2343
|
+
} else {
|
|
2344
|
+
pop.classList.remove("open");
|
|
2345
|
+
}
|
|
2346
|
+
};
|
|
2347
|
+
const trigger = pop.querySelector(".popover-btn") || pop.querySelector("input") || pop;
|
|
2348
|
+
trigger.addEventListener("click", toggle);
|
|
2337
2349
|
document.addEventListener("click", (e) => {
|
|
2338
|
-
if (!pop.contains(e.target))
|
|
2350
|
+
if (!pop.contains(e.target)) {
|
|
2351
|
+
pop.classList.remove("open");
|
|
2352
|
+
}
|
|
2339
2353
|
});
|
|
2340
2354
|
document.addEventListener("keydown", (e) => {
|
|
2341
|
-
if (e.key === "Escape")
|
|
2355
|
+
if (e.key === "Escape") {
|
|
2356
|
+
pop.classList.remove("open");
|
|
2357
|
+
}
|
|
2342
2358
|
});
|
|
2343
2359
|
});
|
|
2344
2360
|
}
|