@tekkare/romulus 0.1.175 → 0.1.176
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/module.json
CHANGED
|
@@ -60,14 +60,22 @@ function place() {
|
|
|
60
60
|
|
|
61
61
|
const wanted = props.align === 'start' ? box.left : box.right - size.width
|
|
62
62
|
const left = Math.max(EDGE, Math.min(wanted, window.innerWidth - size.width - EDGE))
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
|
|
64
|
+
// Le cote le plus large l'emporte : sous le bouton tant que ca tient, au
|
|
65
|
+
// dessus sinon. Une liste plus haute que la fenetre ne peut tenir nulle
|
|
66
|
+
// part : elle prend alors la place disponible et defile, plutot que de
|
|
67
|
+
// sortir par le bas comme le faisait un simple basculement.
|
|
68
|
+
const room = { below: window.innerHeight - box.bottom - 6 - EDGE, above: box.top - 6 - EDGE }
|
|
69
|
+
const below = room.below >= size.height || room.below >= room.above
|
|
70
|
+
const max = Math.max(120, Math.round(below ? room.below : room.above))
|
|
71
|
+
const height = Math.min(size.height, max)
|
|
72
|
+
const top = below ? box.bottom + 6 : box.top - 6 - height
|
|
66
73
|
|
|
67
74
|
style.value = {
|
|
68
75
|
position: 'fixed',
|
|
69
76
|
left: `${Math.round(left)}px`,
|
|
70
|
-
top: `${Math.round(top)}px`,
|
|
77
|
+
top: `${Math.round(Math.max(EDGE, top))}px`,
|
|
78
|
+
maxHeight: `${max}px`,
|
|
71
79
|
}
|
|
72
80
|
}
|
|
73
81
|
|
|
@@ -133,5 +141,5 @@ onBeforeUnmount(() => {
|
|
|
133
141
|
</template>
|
|
134
142
|
|
|
135
143
|
<style scoped>
|
|
136
|
-
.rm-pop{background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);max-width:min(92vw,360px);min-width:220px;padding:var(--space-12);z-index:var(--z-drawer)}.rm-pop-enter-active,.rm-pop-leave-active{transition:transform var(--duration-fast) var(--ease-out),opacity var(--duration-fast) linear}.rm-pop-enter-from,.rm-pop-leave-to{opacity:0;transform:translateY(-4px)}@media (prefers-reduced-motion:reduce){.rm-pop-enter-active,.rm-pop-leave-active{transition:opacity var(--duration-fast) linear}.rm-pop-enter-from,.rm-pop-leave-to{transform:none}}
|
|
144
|
+
.rm-pop{background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);box-sizing:border-box;max-width:min(92vw,360px);min-width:220px;overflow-y:auto;padding:var(--space-12);z-index:var(--z-drawer)}.rm-pop-enter-active,.rm-pop-leave-active{transition:transform var(--duration-fast) var(--ease-out),opacity var(--duration-fast) linear}.rm-pop-enter-from,.rm-pop-leave-to{opacity:0;transform:translateY(-4px)}@media (prefers-reduced-motion:reduce){.rm-pop-enter-active,.rm-pop-leave-active{transition:opacity var(--duration-fast) linear}.rm-pop-enter-from,.rm-pop-leave-to{transform:none}}
|
|
137
145
|
</style>
|