ninemoon-ui 0.0.14 → 0.0.15

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.umd.js CHANGED
@@ -1890,34 +1890,36 @@
1890
1890
  arrowleft = -5;
1891
1891
  break;
1892
1892
  }
1893
- if (top + aimHeight + 10 > scrollTop + window.innerHeight) {
1894
- switch (set == null ? void 0 : set.position) {
1895
- case "bottommiddle":
1896
- case "bottomleft":
1897
- case "bottomright":
1898
- exchange = true;
1899
- top = scrollTop + baseTop - aimHeight - 24;
1900
- break;
1901
- case "centerleft":
1902
- case "centerright":
1903
- top = scrollTop + window.innerHeight - aimHeight - 10;
1904
- arrowtop = baseTop - aimTop + baseHeight / 2 - 10;
1905
- break;
1893
+ if (aimHeight + 20 < window.innerHeight) {
1894
+ if (top + aimHeight + 10 > scrollTop + window.innerHeight) {
1895
+ switch (set == null ? void 0 : set.position) {
1896
+ case "bottommiddle":
1897
+ case "bottomleft":
1898
+ case "bottomright":
1899
+ exchange = true;
1900
+ top = scrollTop + baseTop - aimHeight - 24;
1901
+ break;
1902
+ case "centerleft":
1903
+ case "centerright":
1904
+ top = scrollTop + window.innerHeight - aimHeight - 10;
1905
+ arrowtop = baseTop - aimTop + baseHeight / 2 - 10;
1906
+ break;
1907
+ }
1906
1908
  }
1907
- }
1908
- if (top - scrollTop < 0) {
1909
- switch (set == null ? void 0 : set.position) {
1910
- case "topmiddle":
1911
- case "topleft":
1912
- case "topright":
1913
- exchange = true;
1914
- top = scrollTop + bottom + 24;
1915
- break;
1916
- case "centerleft":
1917
- case "centerright":
1918
- top = 10 + scrollTop;
1919
- arrowtop = baseTop + baseHeight / 2 - 10;
1920
- break;
1909
+ if (top - scrollTop < 0 && scrollTop) {
1910
+ switch (set == null ? void 0 : set.position) {
1911
+ case "topmiddle":
1912
+ case "topleft":
1913
+ case "topright":
1914
+ exchange = true;
1915
+ top = scrollTop + bottom + 24;
1916
+ break;
1917
+ case "centerleft":
1918
+ case "centerright":
1919
+ top = 10 + scrollTop;
1920
+ arrowtop = baseTop + baseHeight / 2 - 10;
1921
+ break;
1922
+ }
1921
1923
  }
1922
1924
  }
1923
1925
  return {
@@ -620,34 +620,36 @@ const usePotion = (baseDom, aimDom, set) => {
620
620
  arrowleft = -5;
621
621
  break;
622
622
  }
623
- if (top + aimHeight + 10 > scrollTop + window.innerHeight) {
624
- switch (set == null ? void 0 : set.position) {
625
- case "bottommiddle":
626
- case "bottomleft":
627
- case "bottomright":
628
- exchange = true;
629
- top = scrollTop + baseTop - aimHeight - 24;
630
- break;
631
- case "centerleft":
632
- case "centerright":
633
- top = scrollTop + window.innerHeight - aimHeight - 10;
634
- arrowtop = baseTop - aimTop + baseHeight / 2 - 10;
635
- break;
623
+ if (aimHeight + 20 < window.innerHeight) {
624
+ if (top + aimHeight + 10 > scrollTop + window.innerHeight) {
625
+ switch (set == null ? void 0 : set.position) {
626
+ case "bottommiddle":
627
+ case "bottomleft":
628
+ case "bottomright":
629
+ exchange = true;
630
+ top = scrollTop + baseTop - aimHeight - 24;
631
+ break;
632
+ case "centerleft":
633
+ case "centerright":
634
+ top = scrollTop + window.innerHeight - aimHeight - 10;
635
+ arrowtop = baseTop - aimTop + baseHeight / 2 - 10;
636
+ break;
637
+ }
636
638
  }
637
- }
638
- if (top - scrollTop < 0) {
639
- switch (set == null ? void 0 : set.position) {
640
- case "topmiddle":
641
- case "topleft":
642
- case "topright":
643
- exchange = true;
644
- top = scrollTop + bottom + 24;
645
- break;
646
- case "centerleft":
647
- case "centerright":
648
- top = 10 + scrollTop;
649
- arrowtop = baseTop + baseHeight / 2 - 10;
650
- break;
639
+ if (top - scrollTop < 0 && scrollTop) {
640
+ switch (set == null ? void 0 : set.position) {
641
+ case "topmiddle":
642
+ case "topleft":
643
+ case "topright":
644
+ exchange = true;
645
+ top = scrollTop + bottom + 24;
646
+ break;
647
+ case "centerleft":
648
+ case "centerright":
649
+ top = 10 + scrollTop;
650
+ arrowtop = baseTop + baseHeight / 2 - 10;
651
+ break;
652
+ }
651
653
  }
652
654
  }
653
655
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninemoon-ui",
3
3
  "private": false,
4
- "version": "0.0.14",
4
+ "version": "0.0.15",
5
5
  "author": "zhuboy",
6
6
  "keywords": [
7
7
  "vue3",