vueless 0.0.256 → 0.0.257
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, toValue } from "vue";
|
|
1
|
+
import { computed, toValue, ref } from "vue";
|
|
2
2
|
|
|
3
3
|
export const POSITION = {
|
|
4
4
|
left: "left",
|
|
@@ -14,10 +14,8 @@ export function useAutoPosition(anchorElement, targetElement, position, preferre
|
|
|
14
14
|
const localPosition = computed(() => toValue(position));
|
|
15
15
|
const localPreferredPosition = computed(() => toValue(preferredPosition));
|
|
16
16
|
|
|
17
|
-
const preferredOpenDirectionY =
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
const preferredOpenDirectionX = computed(() => localPreferredPosition.value?.x || POSITION.left);
|
|
17
|
+
const preferredOpenDirectionY = ref(localPreferredPosition.value?.y || POSITION.bottom);
|
|
18
|
+
const preferredOpenDirectionX = ref(localPreferredPosition.value?.x || POSITION.left);
|
|
21
19
|
|
|
22
20
|
const isTop = computed(() => {
|
|
23
21
|
if (localPosition.value.y !== POSITION.auto) {
|
|
@@ -45,7 +43,7 @@ export function useAutoPosition(anchorElement, targetElement, position, preferre
|
|
|
45
43
|
|
|
46
44
|
const isRight = computed(() => {
|
|
47
45
|
if (localPosition.value.x !== POSITION.auto) {
|
|
48
|
-
return localPosition.value.
|
|
46
|
+
return localPosition.value.x === POSITION.right;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
return preferredOpenDirectionX.value === POSITION.right;
|
package/package.json
CHANGED
|
@@ -18,8 +18,8 @@ export default /*tw*/ {
|
|
|
18
18
|
base: "absolute z-40 my-2 w-80 overflow-hidden rounded-dynamic border border-brand-300 bg-white p-2 shadow focus:outline-none",
|
|
19
19
|
variants: {
|
|
20
20
|
openDirectionX: {
|
|
21
|
-
left: "
|
|
22
|
-
right: "
|
|
21
|
+
left: "right-0",
|
|
22
|
+
right: "left-0",
|
|
23
23
|
},
|
|
24
24
|
openDirectionY: {
|
|
25
25
|
top: "bottom-full mt-0",
|