ninemoon-ui 0.0.12 → 0.0.13
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/components/utils/tool.d.ts +4 -1
- package/dist/index.css +27 -6
- package/dist/index.es.js +31 -31
- package/dist/index.umd.js +139 -84
- package/dist/js/image/image.js +2 -2
- package/dist/js/index/index.js +94 -52
- package/dist/js/popover/popover.js +52 -59
- package/dist/js/scrollBar/scrollBar.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function debounce(func: Function, wait: number): () => void;
|
|
2
|
+
export declare function throttle(func: Function, wait: number): () => void;
|
|
2
3
|
export declare const usePotion: (baseDom: HTMLElement, aimDom: HTMLElement, set?: {
|
|
3
4
|
position: 'topleft' | 'topmiddle' | 'topright' | 'bottomleft' | 'bottommiddle' | 'bottomright' | 'centerleft' | 'centerright';
|
|
4
5
|
divide?: number;
|
|
@@ -7,6 +8,7 @@ export declare const usePotion: (baseDom: HTMLElement, aimDom: HTMLElement, set?
|
|
|
7
8
|
Left: number;
|
|
8
9
|
arrowLeft: number;
|
|
9
10
|
arrowTop: number;
|
|
11
|
+
exChange: boolean;
|
|
10
12
|
};
|
|
11
13
|
export declare function getNewArray(array: Array<any>, subGroupLength: number): any[][];
|
|
12
14
|
export declare function getScrollWidth(): number;
|
|
@@ -40,5 +42,6 @@ export declare const on: (element: {
|
|
|
40
42
|
export declare const off: (element: {
|
|
41
43
|
removeEventListener: (arg0: any, arg1: any, arg2: boolean) => void;
|
|
42
44
|
}, event: any, handler: any) => void;
|
|
45
|
+
export declare function createAndAppendElementWithId(id: string): void;
|
|
43
46
|
declare const _default: {};
|
|
44
47
|
export default _default;
|
package/dist/index.css
CHANGED
|
@@ -807,9 +807,9 @@
|
|
|
807
807
|
content: var(--tw-content);
|
|
808
808
|
position: absolute;
|
|
809
809
|
}
|
|
810
|
-
.before\:tdd-
|
|
810
|
+
.before\:tdd-z-\[-1\]::before {
|
|
811
811
|
content: var(--tw-content);
|
|
812
|
-
|
|
812
|
+
z-index: -1;
|
|
813
813
|
}
|
|
814
814
|
.before\:tdd-h-2::before {
|
|
815
815
|
content: var(--tw-content);
|
|
@@ -831,6 +831,31 @@
|
|
|
831
831
|
content: var(--tw-content);
|
|
832
832
|
--tw-rotate: 45deg;
|
|
833
833
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
834
|
+
}
|
|
835
|
+
.before\:tdd-rounded-bl::before {
|
|
836
|
+
content: var(--tw-content);
|
|
837
|
+
border-bottom-left-radius: 0.25rem;
|
|
838
|
+
}
|
|
839
|
+
.before\:tdd-rounded-br::before {
|
|
840
|
+
content: var(--tw-content);
|
|
841
|
+
border-bottom-right-radius: 0.25rem;
|
|
842
|
+
}
|
|
843
|
+
.before\:tdd-rounded-tl::before {
|
|
844
|
+
content: var(--tw-content);
|
|
845
|
+
border-top-left-radius: 0.25rem;
|
|
846
|
+
}
|
|
847
|
+
.before\:tdd-rounded-tr::before {
|
|
848
|
+
content: var(--tw-content);
|
|
849
|
+
border-top-right-radius: 0.25rem;
|
|
850
|
+
}
|
|
851
|
+
.before\:tdd-border::before {
|
|
852
|
+
content: var(--tw-content);
|
|
853
|
+
border-width: 1px;
|
|
854
|
+
}
|
|
855
|
+
.before\:tdd-border-gray-300::before {
|
|
856
|
+
content: var(--tw-content);
|
|
857
|
+
--tw-border-opacity: 1;
|
|
858
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
|
834
859
|
}
|
|
835
860
|
.before\:tdd-border-b-transparent::before {
|
|
836
861
|
content: var(--tw-content);
|
|
@@ -852,10 +877,6 @@
|
|
|
852
877
|
content: var(--tw-content);
|
|
853
878
|
--tw-bg-opacity: 1;
|
|
854
879
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
855
|
-
}
|
|
856
|
-
.before\:tdd-content-\[\'\'\]::before {
|
|
857
|
-
--tw-content: '';
|
|
858
|
-
content: var(--tw-content);
|
|
859
880
|
}
|
|
860
881
|
.checked\:tdd-border-transparent:checked {
|
|
861
882
|
border-color: transparent;
|
package/dist/index.es.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { H, w, K, N, C, B, q, s, L, f, h, p, j, I, t, M, y, v, x, z, A, G, J, k, l, O, m, n, E, F, P, D, i } from "./js/index/index.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
H as LibAlert,
|
|
5
|
+
w as LibBadge,
|
|
6
|
+
K as LibCarousel,
|
|
7
|
+
N as LibCarouselItem,
|
|
8
|
+
C as LibCheckBox,
|
|
9
|
+
B as LibCheckGroup,
|
|
10
|
+
q as LibDatePicker,
|
|
11
|
+
s as LibDatePickerRange,
|
|
12
12
|
L as LibDialog,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
f as LibForm,
|
|
14
|
+
h as LibFormLabel,
|
|
15
|
+
p as LibImage,
|
|
16
|
+
j as LibInput,
|
|
17
|
+
I as LibLoad,
|
|
18
|
+
t as LibMenu,
|
|
19
19
|
M as LibMessage,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
y as LibNumberInput,
|
|
21
|
+
v as LibPagination,
|
|
22
|
+
x as LibPopover,
|
|
23
|
+
z as LibRadioBox,
|
|
24
|
+
A as LibRadioGroup,
|
|
25
|
+
G as LibScrollBar,
|
|
26
|
+
J as LibScrollLoad,
|
|
27
|
+
k as LibSelect,
|
|
28
|
+
l as LibSelectOption,
|
|
29
|
+
O as LibSwitch,
|
|
30
|
+
m as LibTable,
|
|
31
|
+
n as LibTableItem,
|
|
32
|
+
E as LibTabs,
|
|
33
|
+
F as LibTabsPane,
|
|
34
|
+
P as LibTree,
|
|
35
|
+
D as LibUpload,
|
|
36
36
|
i as default
|
|
37
37
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -812,9 +812,9 @@
|
|
|
812
812
|
content: var(--tw-content);
|
|
813
813
|
position: absolute;
|
|
814
814
|
}
|
|
815
|
-
.before\\:tdd-
|
|
815
|
+
.before\\:tdd-z-\\[-1\\]::before {
|
|
816
816
|
content: var(--tw-content);
|
|
817
|
-
|
|
817
|
+
z-index: -1;
|
|
818
818
|
}
|
|
819
819
|
.before\\:tdd-h-2::before {
|
|
820
820
|
content: var(--tw-content);
|
|
@@ -836,6 +836,31 @@
|
|
|
836
836
|
content: var(--tw-content);
|
|
837
837
|
--tw-rotate: 45deg;
|
|
838
838
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
839
|
+
}
|
|
840
|
+
.before\\:tdd-rounded-bl::before {
|
|
841
|
+
content: var(--tw-content);
|
|
842
|
+
border-bottom-left-radius: 0.25rem;
|
|
843
|
+
}
|
|
844
|
+
.before\\:tdd-rounded-br::before {
|
|
845
|
+
content: var(--tw-content);
|
|
846
|
+
border-bottom-right-radius: 0.25rem;
|
|
847
|
+
}
|
|
848
|
+
.before\\:tdd-rounded-tl::before {
|
|
849
|
+
content: var(--tw-content);
|
|
850
|
+
border-top-left-radius: 0.25rem;
|
|
851
|
+
}
|
|
852
|
+
.before\\:tdd-rounded-tr::before {
|
|
853
|
+
content: var(--tw-content);
|
|
854
|
+
border-top-right-radius: 0.25rem;
|
|
855
|
+
}
|
|
856
|
+
.before\\:tdd-border::before {
|
|
857
|
+
content: var(--tw-content);
|
|
858
|
+
border-width: 1px;
|
|
859
|
+
}
|
|
860
|
+
.before\\:tdd-border-gray-300::before {
|
|
861
|
+
content: var(--tw-content);
|
|
862
|
+
--tw-border-opacity: 1;
|
|
863
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
|
839
864
|
}
|
|
840
865
|
.before\\:tdd-border-b-transparent::before {
|
|
841
866
|
content: var(--tw-content);
|
|
@@ -857,10 +882,6 @@
|
|
|
857
882
|
content: var(--tw-content);
|
|
858
883
|
--tw-bg-opacity: 1;
|
|
859
884
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
860
|
-
}
|
|
861
|
-
.before\\:tdd-content-\\[\\'\\'\\]::before {
|
|
862
|
-
--tw-content: '';
|
|
863
|
-
content: var(--tw-content);
|
|
864
885
|
}
|
|
865
886
|
.checked\\:tdd-border-transparent:checked {
|
|
866
887
|
border-color: transparent;
|
|
@@ -1784,32 +1805,46 @@
|
|
|
1784
1805
|
el.removeChild(el.instance.$el);
|
|
1785
1806
|
}
|
|
1786
1807
|
};
|
|
1787
|
-
|
|
1788
|
-
let
|
|
1808
|
+
function debounce(func, wait) {
|
|
1809
|
+
let timeout;
|
|
1789
1810
|
return function() {
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1811
|
+
const context = this;
|
|
1812
|
+
const args = arguments;
|
|
1813
|
+
clearTimeout(timeout);
|
|
1814
|
+
timeout = setTimeout(function() {
|
|
1815
|
+
func.apply(context, args);
|
|
1816
|
+
}, wait);
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
function throttle(func, wait) {
|
|
1820
|
+
let timeout;
|
|
1821
|
+
return function() {
|
|
1822
|
+
const context = this;
|
|
1823
|
+
const args = arguments;
|
|
1824
|
+
if (!timeout) {
|
|
1825
|
+
timeout = setTimeout(function() {
|
|
1826
|
+
timeout = null;
|
|
1827
|
+
func.apply(context, args);
|
|
1828
|
+
}, wait);
|
|
1795
1829
|
}
|
|
1796
|
-
flag = false;
|
|
1797
1830
|
};
|
|
1798
|
-
}
|
|
1831
|
+
}
|
|
1799
1832
|
const usePotion = (baseDom, aimDom, set) => {
|
|
1800
1833
|
let left = 0;
|
|
1801
1834
|
let top = 0;
|
|
1802
1835
|
let arrowleft = 0;
|
|
1803
1836
|
let arrowtop = 0;
|
|
1837
|
+
let exchange = false;
|
|
1804
1838
|
if (!baseDom || !aimDom) {
|
|
1805
1839
|
return {
|
|
1806
1840
|
Top: top,
|
|
1807
1841
|
Left: left,
|
|
1808
1842
|
arrowLeft: arrowleft,
|
|
1809
|
-
arrowTop: arrowtop
|
|
1843
|
+
arrowTop: arrowtop,
|
|
1844
|
+
exChange: exchange
|
|
1810
1845
|
};
|
|
1811
1846
|
}
|
|
1812
|
-
const { left: baseLeft, right, bottom, top: baseTop, width: baseWidth } = baseDom.getBoundingClientRect();
|
|
1847
|
+
const { left: baseLeft, right, bottom, top: baseTop, width: baseWidth, height: baseHeight } = baseDom.getBoundingClientRect();
|
|
1813
1848
|
const { height: aimHeight, width: aimWidth } = aimDom.getBoundingClientRect();
|
|
1814
1849
|
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
1815
1850
|
const scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
@@ -1818,13 +1853,11 @@
|
|
|
1818
1853
|
case "bottommiddle":
|
|
1819
1854
|
case "bottomright":
|
|
1820
1855
|
top = scrollTop + bottom;
|
|
1821
|
-
arrowtop = -5;
|
|
1822
1856
|
break;
|
|
1823
1857
|
case "topleft":
|
|
1824
1858
|
case "topmiddle":
|
|
1825
1859
|
case "topright":
|
|
1826
1860
|
top = scrollTop + baseTop - aimHeight;
|
|
1827
|
-
arrowtop = aimHeight - 5;
|
|
1828
1861
|
break;
|
|
1829
1862
|
case "centerleft":
|
|
1830
1863
|
case "centerright":
|
|
@@ -1857,20 +1890,42 @@
|
|
|
1857
1890
|
arrowleft = -5;
|
|
1858
1891
|
break;
|
|
1859
1892
|
}
|
|
1860
|
-
if (top + aimHeight > window.innerHeight) {
|
|
1861
|
-
|
|
1893
|
+
if (top + aimHeight + 10 > 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 + baseHeight / 2 - 10;
|
|
1905
|
+
break;
|
|
1906
|
+
}
|
|
1862
1907
|
}
|
|
1863
1908
|
if (top < 0) {
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
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;
|
|
1919
|
+
arrowtop = baseTop + baseHeight / 2 - 10;
|
|
1920
|
+
break;
|
|
1921
|
+
}
|
|
1868
1922
|
}
|
|
1869
1923
|
return {
|
|
1870
1924
|
Top: top,
|
|
1871
1925
|
Left: left,
|
|
1872
1926
|
arrowLeft: arrowleft,
|
|
1873
|
-
arrowTop: arrowtop
|
|
1927
|
+
arrowTop: arrowtop,
|
|
1928
|
+
exChange: exchange
|
|
1874
1929
|
};
|
|
1875
1930
|
};
|
|
1876
1931
|
function getNewArray(array, subGroupLength) {
|
|
@@ -1940,6 +1995,13 @@
|
|
|
1940
1995
|
}
|
|
1941
1996
|
};
|
|
1942
1997
|
}();
|
|
1998
|
+
function createAndAppendElementWithId(id) {
|
|
1999
|
+
if (!document.getElementById(id)) {
|
|
2000
|
+
const element = document.createElement("div");
|
|
2001
|
+
element.id = id;
|
|
2002
|
+
document.body.appendChild(element);
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
1943
2005
|
const scrolllead = {
|
|
1944
2006
|
beforeMount(el, binding) {
|
|
1945
2007
|
function scrollhandle(e) {
|
|
@@ -2998,7 +3060,7 @@
|
|
|
2998
3060
|
mouseX = e.pageX;
|
|
2999
3061
|
mouseY = e.pageY;
|
|
3000
3062
|
ImgIsMoving.value = true;
|
|
3001
|
-
el._vueMove_ =
|
|
3063
|
+
el._vueMove_ = debounce(setMoveHandle, 60);
|
|
3002
3064
|
window.addEventListener("mousemove", el._vueMove_);
|
|
3003
3065
|
}
|
|
3004
3066
|
function upHandle() {
|
|
@@ -4522,9 +4584,12 @@
|
|
|
4522
4584
|
emits: ["update:modelValue"],
|
|
4523
4585
|
setup(__props, { expose: __expose, emit: emitAct }) {
|
|
4524
4586
|
const props = __props;
|
|
4587
|
+
const bindName = vue.ref("body");
|
|
4525
4588
|
const base = vue.ref();
|
|
4526
4589
|
const pop = vue.ref();
|
|
4527
4590
|
const showPop = vue.ref(false);
|
|
4591
|
+
createAndAppendElementWithId("tdd-pop");
|
|
4592
|
+
bindName.value = "#tdd-pop";
|
|
4528
4593
|
const trueFlag = vue.computed(() => {
|
|
4529
4594
|
if (showPop.value || props.trigger === "native" && props.modelValue) {
|
|
4530
4595
|
vue.nextTick(() => {
|
|
@@ -4562,22 +4627,41 @@
|
|
|
4562
4627
|
}
|
|
4563
4628
|
return margin;
|
|
4564
4629
|
});
|
|
4630
|
+
const styleConditions = {
|
|
4631
|
+
left: (placement) => ["topleft", "topmiddle", "topright", "bottomleft", "bottommiddle", "bottomright"].includes(placement) ? `${arrowLeft.value}px` : "centerright" == placement ? "-5px" : null,
|
|
4632
|
+
right: (placement) => "centerleft" == placement ? "-5px" : null,
|
|
4633
|
+
top: (placement, exChange2) => ["bottomleft", "bottommiddle", "bottomright"].includes(placement) && !exChange2 ? "-5px" : ["topleft", "topmiddle", "topright"].includes(placement) && exChange2 ? "-5px" : ["centerright", "centerleft"].includes(placement) ? `${arrowTop.value}px` : null,
|
|
4634
|
+
bottom: (placement, exChange2) => ["topleft", "topmiddle", "topright"].includes(placement) && !exChange2 ? "-5px" : ["bottomleft", "bottommiddle", "bottomright"].includes(placement) && exChange2 ? "-5px" : null
|
|
4635
|
+
};
|
|
4565
4636
|
const arrowHandle = () => {
|
|
4637
|
+
const resultStyles = {};
|
|
4638
|
+
for (const styleName in styleConditions) {
|
|
4639
|
+
const condition = styleConditions[styleName];
|
|
4640
|
+
if (typeof condition === "function") {
|
|
4641
|
+
resultStyles[styleName] = condition(props.placement, exChange.value);
|
|
4642
|
+
} else if (condition) {
|
|
4643
|
+
resultStyles[styleName] = condition;
|
|
4644
|
+
}
|
|
4645
|
+
}
|
|
4646
|
+
const publicClass = "tdd-absolute tdd-z-1000 tdd-w-2.5 tdd-h-2.5 before:tdd-z-[-1] before:tdd-border before:tdd-border-gray-300 before:tdd-bg-white before:tdd-content-border before:tdd-rotate-45 before:tdd-content-[' '] before:tdd-w-2.5 before:tdd-h-2.5 before:tdd-absolute";
|
|
4566
4647
|
return vue.h(
|
|
4567
4648
|
"span",
|
|
4568
4649
|
{
|
|
4569
|
-
class: vue.normalizeClass(
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4650
|
+
class: vue.normalizeClass(
|
|
4651
|
+
[
|
|
4652
|
+
publicClass,
|
|
4653
|
+
["topleft", "topmiddle", "topright"].includes(props.placement) && !exChange.value ? "before:tdd-border-t-transparent before:tdd-border-l-transparent before:tdd-rounded-br" : "",
|
|
4654
|
+
["topleft", "topmiddle", "topright"].includes(props.placement) && exChange.value ? "before:tdd-border-b-transparent before:tdd-border-r-transparent before:tdd-rounded-tl" : "",
|
|
4655
|
+
["bottomleft", "bottommiddle", "bottomright"].includes(props.placement) && !exChange.value ? "before:tdd-border-b-transparent before:tdd-border-r-transparent before:tdd-rounded-tl" : "",
|
|
4656
|
+
["bottomleft", "bottommiddle", "bottomright"].includes(props.placement) && exChange.value ? "before:tdd-border-t-transparent before:tdd-border-l-transparent before:tdd-rounded-br" : "",
|
|
4657
|
+
"centerright" == props.placement ? "before:tdd-border-r-transparent before:tdd-border-t-transparent before:tdd-rounded-bl" : "",
|
|
4658
|
+
"centerleft" == props.placement ? "before:tdd-border-l-transparent before:tdd-border-b-transparent before:tdd-rounded-tr" : "",
|
|
4659
|
+
props.beforebgcolor
|
|
4660
|
+
]
|
|
4661
|
+
),
|
|
4662
|
+
style: vue.normalizeStyle(
|
|
4663
|
+
resultStyles
|
|
4664
|
+
)
|
|
4581
4665
|
}
|
|
4582
4666
|
);
|
|
4583
4667
|
};
|
|
@@ -4593,12 +4677,8 @@
|
|
|
4593
4677
|
const Top = vue.ref(0);
|
|
4594
4678
|
const arrowLeft = vue.ref(0);
|
|
4595
4679
|
const arrowTop = vue.ref(0);
|
|
4680
|
+
const exChange = vue.ref(false);
|
|
4596
4681
|
const setPosition = () => {
|
|
4597
|
-
if (!pop.value) {
|
|
4598
|
-
window.removeEventListener("resize", setPosition);
|
|
4599
|
-
window.removeEventListener("scroll", setPosition, true);
|
|
4600
|
-
return;
|
|
4601
|
-
}
|
|
4602
4682
|
const { top, bottom } = base.value.getBoundingClientRect();
|
|
4603
4683
|
if (top < 0 || bottom > window.innerHeight) {
|
|
4604
4684
|
if (props.trigger === "native") {
|
|
@@ -4608,8 +4688,6 @@
|
|
|
4608
4688
|
}
|
|
4609
4689
|
return;
|
|
4610
4690
|
}
|
|
4611
|
-
window.addEventListener("resize", setPosition);
|
|
4612
|
-
window.addEventListener("scroll", setPosition, true);
|
|
4613
4691
|
const position = usePotion(base.value, pop.value, {
|
|
4614
4692
|
position: props.placement
|
|
4615
4693
|
});
|
|
@@ -4617,23 +4695,25 @@
|
|
|
4617
4695
|
Left.value = position.Left;
|
|
4618
4696
|
arrowTop.value = position.arrowTop;
|
|
4619
4697
|
arrowLeft.value = position.arrowLeft;
|
|
4698
|
+
exChange.value = position.exChange;
|
|
4699
|
+
window.addEventListener("resize", setPosition);
|
|
4700
|
+
window.addEventListener("scroll", setPosition, true);
|
|
4620
4701
|
};
|
|
4621
4702
|
const vClickoutside = {
|
|
4622
4703
|
mounted(el, binding) {
|
|
4623
|
-
if (!(el instanceof HTMLElement)) {
|
|
4624
|
-
console.error("el must be an instance of HTMLElement");
|
|
4625
|
-
return;
|
|
4626
|
-
}
|
|
4627
4704
|
function documentHandler(e) {
|
|
4628
|
-
|
|
4705
|
+
var _a;
|
|
4706
|
+
if (trueFlag.value == false)
|
|
4707
|
+
return;
|
|
4708
|
+
if (el.contains(e.target)) {
|
|
4629
4709
|
return false;
|
|
4630
|
-
} else if (base.value.contains(e.target)) {
|
|
4710
|
+
} else if ((_a = base.value) == null ? void 0 : _a.contains(e.target)) {
|
|
4631
4711
|
return false;
|
|
4632
4712
|
} else {
|
|
4633
4713
|
binding.value && binding.value(e);
|
|
4634
4714
|
}
|
|
4635
4715
|
}
|
|
4636
|
-
el._vueClickOutside_ =
|
|
4716
|
+
el._vueClickOutside_ = debounce(documentHandler, 80);
|
|
4637
4717
|
document.addEventListener("click", el._vueClickOutside_);
|
|
4638
4718
|
switch (props.trigger) {
|
|
4639
4719
|
case "hover":
|
|
@@ -4642,10 +4722,6 @@
|
|
|
4642
4722
|
}
|
|
4643
4723
|
},
|
|
4644
4724
|
beforeUnmount(el) {
|
|
4645
|
-
if (!(el instanceof HTMLElement)) {
|
|
4646
|
-
console.error("el must be an instance of HTMLElement");
|
|
4647
|
-
return;
|
|
4648
|
-
}
|
|
4649
4725
|
document.removeEventListener("click", el._vueClickOutside_);
|
|
4650
4726
|
switch (props.trigger) {
|
|
4651
4727
|
case "hover":
|
|
@@ -4656,6 +4732,7 @@
|
|
|
4656
4732
|
}
|
|
4657
4733
|
};
|
|
4658
4734
|
const closeCenter = () => {
|
|
4735
|
+
console.log(1111);
|
|
4659
4736
|
if (props.beforeHidden) {
|
|
4660
4737
|
props.beforeHidden(hideHandle);
|
|
4661
4738
|
} else {
|
|
@@ -4706,37 +4783,15 @@
|
|
|
4706
4783
|
}, [
|
|
4707
4784
|
vue.renderSlot(_ctx.$slots, "reference"),
|
|
4708
4785
|
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
4709
|
-
to:
|
|
4786
|
+
to: bindName.value,
|
|
4710
4787
|
disabled: !trueFlag.value
|
|
4711
4788
|
}, [
|
|
4712
|
-
|
|
4713
|
-
key: 0,
|
|
4714
|
-
name: "opecity"
|
|
4715
|
-
}, {
|
|
4716
|
-
default: vue.withCtx(() => [
|
|
4717
|
-
trueFlag.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
4718
|
-
key: 0,
|
|
4719
|
-
ref_key: "pop",
|
|
4720
|
-
ref: pop,
|
|
4721
|
-
class: vue.normalizeClass(["tdd-absolute tdd-z-1000 tdd-rounded tdd-bg-white tdd-p-4 tdd-drop-shadow", [marginClass.value, _ctx.insertClass]]),
|
|
4722
|
-
style: vue.normalizeStyle({ width: widthNum.value, top: `${Top.value}px`, left: `${Left.value}px` })
|
|
4723
|
-
}, [
|
|
4724
|
-
vue.renderSlot(_ctx.$slots, "default"),
|
|
4725
|
-
vue.createVNode(arrowHandle)
|
|
4726
|
-
], 6)), [
|
|
4727
|
-
[vClickoutside, closeCenter]
|
|
4728
|
-
]) : vue.createCommentVNode("", true)
|
|
4729
|
-
]),
|
|
4730
|
-
_: 3
|
|
4731
|
-
})) : (vue.openBlock(), vue.createBlock(vue.Transition, {
|
|
4732
|
-
key: 1,
|
|
4733
|
-
name: "opecity"
|
|
4734
|
-
}, {
|
|
4789
|
+
vue.createVNode(vue.Transition, { name: "opecity" }, {
|
|
4735
4790
|
default: vue.withCtx(() => [
|
|
4736
4791
|
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
4737
4792
|
ref_key: "pop",
|
|
4738
4793
|
ref: pop,
|
|
4739
|
-
class: vue.normalizeClass(["tdd-absolute tdd-z-1000 tdd-rounded tdd-bg-white tdd-p-4 tdd-drop-shadow", [marginClass.value, _ctx.insertClass]]),
|
|
4794
|
+
class: vue.normalizeClass(["tdd-absolute tdd-z-1000 tdd-rounded tdd-bg-white tdd-p-4 tdd-drop-shadow tdd-border tdd-border-gray-300 tdd-box-border", [marginClass.value, _ctx.insertClass]]),
|
|
4740
4795
|
style: vue.normalizeStyle({ width: widthNum.value, top: `${Top.value}px`, left: `${Left.value}px` })
|
|
4741
4796
|
}, [
|
|
4742
4797
|
vue.renderSlot(_ctx.$slots, "default"),
|
|
@@ -4747,8 +4802,8 @@
|
|
|
4747
4802
|
])
|
|
4748
4803
|
]),
|
|
4749
4804
|
_: 3
|
|
4750
|
-
})
|
|
4751
|
-
], 8, ["disabled"]))
|
|
4805
|
+
})
|
|
4806
|
+
], 8, ["to", "disabled"]))
|
|
4752
4807
|
], 40, _hoisted_1$7);
|
|
4753
4808
|
};
|
|
4754
4809
|
}
|
package/dist/js/image/image.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, openBlock, createElementBlock, Fragment, createElementVNode, createCommentVNode, renderSlot, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, withModifiers, normalizeStyle, normalizeClass, nextTick } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { d as debounce } from "../index/index.js";
|
|
3
3
|
const _hoisted_1 = { class: "tdd-relative tdd-inline-block tdd-h-full tdd-w-full" };
|
|
4
4
|
const _hoisted_2 = ["src"];
|
|
5
5
|
const _hoisted_3 = /* @__PURE__ */ createElementVNode("svg", {
|
|
@@ -109,7 +109,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
109
109
|
mouseX = e.pageX;
|
|
110
110
|
mouseY = e.pageY;
|
|
111
111
|
ImgIsMoving.value = true;
|
|
112
|
-
el._vueMove_ =
|
|
112
|
+
el._vueMove_ = debounce(setMoveHandle, 60);
|
|
113
113
|
window.addEventListener("mousemove", el._vueMove_);
|
|
114
114
|
}
|
|
115
115
|
function upHandle() {
|
package/dist/js/index/index.js
CHANGED
|
@@ -535,32 +535,46 @@ const removeHandle = (el, root) => {
|
|
|
535
535
|
el.removeChild(el.instance.$el);
|
|
536
536
|
}
|
|
537
537
|
};
|
|
538
|
-
|
|
539
|
-
let
|
|
538
|
+
function debounce(func, wait) {
|
|
539
|
+
let timeout;
|
|
540
540
|
return function() {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
541
|
+
const context = this;
|
|
542
|
+
const args = arguments;
|
|
543
|
+
clearTimeout(timeout);
|
|
544
|
+
timeout = setTimeout(function() {
|
|
545
|
+
func.apply(context, args);
|
|
546
|
+
}, wait);
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function throttle(func, wait) {
|
|
550
|
+
let timeout;
|
|
551
|
+
return function() {
|
|
552
|
+
const context = this;
|
|
553
|
+
const args = arguments;
|
|
554
|
+
if (!timeout) {
|
|
555
|
+
timeout = setTimeout(function() {
|
|
556
|
+
timeout = null;
|
|
557
|
+
func.apply(context, args);
|
|
558
|
+
}, wait);
|
|
546
559
|
}
|
|
547
|
-
flag = false;
|
|
548
560
|
};
|
|
549
|
-
}
|
|
561
|
+
}
|
|
550
562
|
const usePotion = (baseDom, aimDom, set) => {
|
|
551
563
|
let left = 0;
|
|
552
564
|
let top = 0;
|
|
553
565
|
let arrowleft = 0;
|
|
554
566
|
let arrowtop = 0;
|
|
567
|
+
let exchange = false;
|
|
555
568
|
if (!baseDom || !aimDom) {
|
|
556
569
|
return {
|
|
557
570
|
Top: top,
|
|
558
571
|
Left: left,
|
|
559
572
|
arrowLeft: arrowleft,
|
|
560
|
-
arrowTop: arrowtop
|
|
573
|
+
arrowTop: arrowtop,
|
|
574
|
+
exChange: exchange
|
|
561
575
|
};
|
|
562
576
|
}
|
|
563
|
-
const { left: baseLeft, right, bottom, top: baseTop, width: baseWidth } = baseDom.getBoundingClientRect();
|
|
577
|
+
const { left: baseLeft, right, bottom, top: baseTop, width: baseWidth, height: baseHeight } = baseDom.getBoundingClientRect();
|
|
564
578
|
const { height: aimHeight, width: aimWidth } = aimDom.getBoundingClientRect();
|
|
565
579
|
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
566
580
|
const scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
@@ -569,13 +583,11 @@ const usePotion = (baseDom, aimDom, set) => {
|
|
|
569
583
|
case "bottommiddle":
|
|
570
584
|
case "bottomright":
|
|
571
585
|
top = scrollTop + bottom;
|
|
572
|
-
arrowtop = -5;
|
|
573
586
|
break;
|
|
574
587
|
case "topleft":
|
|
575
588
|
case "topmiddle":
|
|
576
589
|
case "topright":
|
|
577
590
|
top = scrollTop + baseTop - aimHeight;
|
|
578
|
-
arrowtop = aimHeight - 5;
|
|
579
591
|
break;
|
|
580
592
|
case "centerleft":
|
|
581
593
|
case "centerright":
|
|
@@ -608,20 +620,42 @@ const usePotion = (baseDom, aimDom, set) => {
|
|
|
608
620
|
arrowleft = -5;
|
|
609
621
|
break;
|
|
610
622
|
}
|
|
611
|
-
if (top + aimHeight > window.innerHeight) {
|
|
612
|
-
|
|
623
|
+
if (top + aimHeight + 10 > 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 + baseHeight / 2 - 10;
|
|
635
|
+
break;
|
|
636
|
+
}
|
|
613
637
|
}
|
|
614
638
|
if (top < 0) {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
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;
|
|
649
|
+
arrowtop = baseTop + baseHeight / 2 - 10;
|
|
650
|
+
break;
|
|
651
|
+
}
|
|
619
652
|
}
|
|
620
653
|
return {
|
|
621
654
|
Top: top,
|
|
622
655
|
Left: left,
|
|
623
656
|
arrowLeft: arrowleft,
|
|
624
|
-
arrowTop: arrowtop
|
|
657
|
+
arrowTop: arrowtop,
|
|
658
|
+
exChange: exchange
|
|
625
659
|
};
|
|
626
660
|
};
|
|
627
661
|
function getNewArray(array, subGroupLength) {
|
|
@@ -691,6 +725,13 @@ const off = function() {
|
|
|
691
725
|
}
|
|
692
726
|
};
|
|
693
727
|
}();
|
|
728
|
+
function createAndAppendElementWithId(id) {
|
|
729
|
+
if (!document.getElementById(id)) {
|
|
730
|
+
const element = document.createElement("div");
|
|
731
|
+
element.id = id;
|
|
732
|
+
document.body.appendChild(element);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
694
735
|
const scrolllead = {
|
|
695
736
|
beforeMount(el, binding) {
|
|
696
737
|
function scrollhandle(e) {
|
|
@@ -784,45 +825,46 @@ const index = {
|
|
|
784
825
|
}
|
|
785
826
|
};
|
|
786
827
|
export {
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
828
|
+
LibRadioGroup as A,
|
|
829
|
+
LibCheckGroup as B,
|
|
830
|
+
LibCheckBox as C,
|
|
831
|
+
LibUpload as D,
|
|
832
|
+
LibTabs as E,
|
|
833
|
+
LibTabsPane as F,
|
|
834
|
+
LibScrollBar as G,
|
|
835
|
+
AlertCom as H,
|
|
836
|
+
LibLoad as I,
|
|
837
|
+
scrolllead as J,
|
|
838
|
+
LibCarousel as K,
|
|
798
839
|
LibDialog as L,
|
|
799
840
|
MessageCom as M,
|
|
800
|
-
|
|
801
|
-
|
|
841
|
+
LibCarouselItem as N,
|
|
842
|
+
LibSwitch as O,
|
|
843
|
+
LibTree as P,
|
|
802
844
|
off as a,
|
|
803
845
|
getScrollWidth as b,
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
846
|
+
createAndAppendElementWithId as c,
|
|
847
|
+
debounce as d,
|
|
848
|
+
addResizeListener as e,
|
|
849
|
+
LibForm as f,
|
|
808
850
|
getNewArray as g,
|
|
809
|
-
|
|
851
|
+
LibFormLabel as h,
|
|
810
852
|
index as i,
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
853
|
+
LibInput as j,
|
|
854
|
+
LibSelect as k,
|
|
855
|
+
LibSelectOption as l,
|
|
856
|
+
LibTable as m,
|
|
857
|
+
LibTableItem as n,
|
|
816
858
|
on as o,
|
|
817
|
-
|
|
818
|
-
|
|
859
|
+
LibImage as p,
|
|
860
|
+
LibDatePicker as q,
|
|
819
861
|
removeResizeListener as r,
|
|
820
|
-
|
|
821
|
-
|
|
862
|
+
LibDatePickerRange as s,
|
|
863
|
+
LibMenu as t,
|
|
822
864
|
usePotion as u,
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
865
|
+
LibPagination as v,
|
|
866
|
+
LibBadge as w,
|
|
867
|
+
LibPopover as x,
|
|
868
|
+
LibNumberInput as y,
|
|
869
|
+
LibRadioBox as z
|
|
828
870
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, nextTick, onUnmounted, openBlock, createElementBlock, withModifiers, renderSlot, createBlock, Teleport, Transition, withCtx, withDirectives, normalizeClass, normalizeStyle,
|
|
2
|
-
import { u as usePotion,
|
|
1
|
+
import { defineComponent, ref, computed, nextTick, onUnmounted, openBlock, createElementBlock, withModifiers, renderSlot, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, normalizeClass, normalizeStyle, vShow, h } from "vue";
|
|
2
|
+
import { c as createAndAppendElementWithId, u as usePotion, d as debounce } from "../index/index.js";
|
|
3
3
|
const _hoisted_1 = ["onMouseenter"];
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "popover",
|
|
@@ -16,9 +16,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
emits: ["update:modelValue"],
|
|
17
17
|
setup(__props, { expose: __expose, emit: emitAct }) {
|
|
18
18
|
const props = __props;
|
|
19
|
+
const bindName = ref("body");
|
|
19
20
|
const base = ref();
|
|
20
21
|
const pop = ref();
|
|
21
22
|
const showPop = ref(false);
|
|
23
|
+
createAndAppendElementWithId("tdd-pop");
|
|
24
|
+
bindName.value = "#tdd-pop";
|
|
22
25
|
const trueFlag = computed(() => {
|
|
23
26
|
if (showPop.value || props.trigger === "native" && props.modelValue) {
|
|
24
27
|
nextTick(() => {
|
|
@@ -56,22 +59,41 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
56
59
|
}
|
|
57
60
|
return margin;
|
|
58
61
|
});
|
|
62
|
+
const styleConditions = {
|
|
63
|
+
left: (placement) => ["topleft", "topmiddle", "topright", "bottomleft", "bottommiddle", "bottomright"].includes(placement) ? `${arrowLeft.value}px` : "centerright" == placement ? "-5px" : null,
|
|
64
|
+
right: (placement) => "centerleft" == placement ? "-5px" : null,
|
|
65
|
+
top: (placement, exChange2) => ["bottomleft", "bottommiddle", "bottomright"].includes(placement) && !exChange2 ? "-5px" : ["topleft", "topmiddle", "topright"].includes(placement) && exChange2 ? "-5px" : ["centerright", "centerleft"].includes(placement) ? `${arrowTop.value}px` : null,
|
|
66
|
+
bottom: (placement, exChange2) => ["topleft", "topmiddle", "topright"].includes(placement) && !exChange2 ? "-5px" : ["bottomleft", "bottommiddle", "bottomright"].includes(placement) && exChange2 ? "-5px" : null
|
|
67
|
+
};
|
|
59
68
|
const arrowHandle = () => {
|
|
69
|
+
const resultStyles = {};
|
|
70
|
+
for (const styleName in styleConditions) {
|
|
71
|
+
const condition = styleConditions[styleName];
|
|
72
|
+
if (typeof condition === "function") {
|
|
73
|
+
resultStyles[styleName] = condition(props.placement, exChange.value);
|
|
74
|
+
} else if (condition) {
|
|
75
|
+
resultStyles[styleName] = condition;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const publicClass = "tdd-absolute tdd-z-1000 tdd-w-2.5 tdd-h-2.5 before:tdd-z-[-1] before:tdd-border before:tdd-border-gray-300 before:tdd-bg-white before:tdd-content-border before:tdd-rotate-45 before:tdd-content-[' '] before:tdd-w-2.5 before:tdd-h-2.5 before:tdd-absolute";
|
|
60
79
|
return h(
|
|
61
80
|
"span",
|
|
62
81
|
{
|
|
63
|
-
class: normalizeClass(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
82
|
+
class: normalizeClass(
|
|
83
|
+
[
|
|
84
|
+
publicClass,
|
|
85
|
+
["topleft", "topmiddle", "topright"].includes(props.placement) && !exChange.value ? "before:tdd-border-t-transparent before:tdd-border-l-transparent before:tdd-rounded-br" : "",
|
|
86
|
+
["topleft", "topmiddle", "topright"].includes(props.placement) && exChange.value ? "before:tdd-border-b-transparent before:tdd-border-r-transparent before:tdd-rounded-tl" : "",
|
|
87
|
+
["bottomleft", "bottommiddle", "bottomright"].includes(props.placement) && !exChange.value ? "before:tdd-border-b-transparent before:tdd-border-r-transparent before:tdd-rounded-tl" : "",
|
|
88
|
+
["bottomleft", "bottommiddle", "bottomright"].includes(props.placement) && exChange.value ? "before:tdd-border-t-transparent before:tdd-border-l-transparent before:tdd-rounded-br" : "",
|
|
89
|
+
"centerright" == props.placement ? "before:tdd-border-r-transparent before:tdd-border-t-transparent before:tdd-rounded-bl" : "",
|
|
90
|
+
"centerleft" == props.placement ? "before:tdd-border-l-transparent before:tdd-border-b-transparent before:tdd-rounded-tr" : "",
|
|
91
|
+
props.beforebgcolor
|
|
92
|
+
]
|
|
93
|
+
),
|
|
94
|
+
style: normalizeStyle(
|
|
95
|
+
resultStyles
|
|
96
|
+
)
|
|
75
97
|
}
|
|
76
98
|
);
|
|
77
99
|
};
|
|
@@ -87,12 +109,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
87
109
|
const Top = ref(0);
|
|
88
110
|
const arrowLeft = ref(0);
|
|
89
111
|
const arrowTop = ref(0);
|
|
112
|
+
const exChange = ref(false);
|
|
90
113
|
const setPosition = () => {
|
|
91
|
-
if (!pop.value) {
|
|
92
|
-
window.removeEventListener("resize", setPosition);
|
|
93
|
-
window.removeEventListener("scroll", setPosition, true);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
114
|
const { top, bottom } = base.value.getBoundingClientRect();
|
|
97
115
|
if (top < 0 || bottom > window.innerHeight) {
|
|
98
116
|
if (props.trigger === "native") {
|
|
@@ -102,8 +120,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
102
120
|
}
|
|
103
121
|
return;
|
|
104
122
|
}
|
|
105
|
-
window.addEventListener("resize", setPosition);
|
|
106
|
-
window.addEventListener("scroll", setPosition, true);
|
|
107
123
|
const position = usePotion(base.value, pop.value, {
|
|
108
124
|
position: props.placement
|
|
109
125
|
});
|
|
@@ -111,23 +127,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
111
127
|
Left.value = position.Left;
|
|
112
128
|
arrowTop.value = position.arrowTop;
|
|
113
129
|
arrowLeft.value = position.arrowLeft;
|
|
130
|
+
exChange.value = position.exChange;
|
|
131
|
+
window.addEventListener("resize", setPosition);
|
|
132
|
+
window.addEventListener("scroll", setPosition, true);
|
|
114
133
|
};
|
|
115
134
|
const vClickoutside = {
|
|
116
135
|
mounted(el, binding) {
|
|
117
|
-
if (!(el instanceof HTMLElement)) {
|
|
118
|
-
console.error("el must be an instance of HTMLElement");
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
136
|
function documentHandler(e) {
|
|
122
|
-
|
|
137
|
+
var _a;
|
|
138
|
+
if (trueFlag.value == false)
|
|
139
|
+
return;
|
|
140
|
+
if (el.contains(e.target)) {
|
|
123
141
|
return false;
|
|
124
|
-
} else if (base.value.contains(e.target)) {
|
|
142
|
+
} else if ((_a = base.value) == null ? void 0 : _a.contains(e.target)) {
|
|
125
143
|
return false;
|
|
126
144
|
} else {
|
|
127
145
|
binding.value && binding.value(e);
|
|
128
146
|
}
|
|
129
147
|
}
|
|
130
|
-
el._vueClickOutside_ =
|
|
148
|
+
el._vueClickOutside_ = debounce(documentHandler, 80);
|
|
131
149
|
document.addEventListener("click", el._vueClickOutside_);
|
|
132
150
|
switch (props.trigger) {
|
|
133
151
|
case "hover":
|
|
@@ -136,10 +154,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
136
154
|
}
|
|
137
155
|
},
|
|
138
156
|
beforeUnmount(el) {
|
|
139
|
-
if (!(el instanceof HTMLElement)) {
|
|
140
|
-
console.error("el must be an instance of HTMLElement");
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
157
|
document.removeEventListener("click", el._vueClickOutside_);
|
|
144
158
|
switch (props.trigger) {
|
|
145
159
|
case "hover":
|
|
@@ -150,6 +164,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
150
164
|
}
|
|
151
165
|
};
|
|
152
166
|
const closeCenter = () => {
|
|
167
|
+
console.log(1111);
|
|
153
168
|
if (props.beforeHidden) {
|
|
154
169
|
props.beforeHidden(hideHandle);
|
|
155
170
|
} else {
|
|
@@ -200,37 +215,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
200
215
|
}, [
|
|
201
216
|
renderSlot(_ctx.$slots, "reference"),
|
|
202
217
|
(openBlock(), createBlock(Teleport, {
|
|
203
|
-
to:
|
|
218
|
+
to: bindName.value,
|
|
204
219
|
disabled: !trueFlag.value
|
|
205
220
|
}, [
|
|
206
|
-
|
|
207
|
-
key: 0,
|
|
208
|
-
name: "opecity"
|
|
209
|
-
}, {
|
|
210
|
-
default: withCtx(() => [
|
|
211
|
-
trueFlag.value ? withDirectives((openBlock(), createElementBlock("div", {
|
|
212
|
-
key: 0,
|
|
213
|
-
ref_key: "pop",
|
|
214
|
-
ref: pop,
|
|
215
|
-
class: normalizeClass(["tdd-absolute tdd-z-1000 tdd-rounded tdd-bg-white tdd-p-4 tdd-drop-shadow", [marginClass.value, _ctx.insertClass]]),
|
|
216
|
-
style: normalizeStyle({ width: widthNum.value, top: `${Top.value}px`, left: `${Left.value}px` })
|
|
217
|
-
}, [
|
|
218
|
-
renderSlot(_ctx.$slots, "default"),
|
|
219
|
-
createVNode(arrowHandle)
|
|
220
|
-
], 6)), [
|
|
221
|
-
[vClickoutside, closeCenter]
|
|
222
|
-
]) : createCommentVNode("", true)
|
|
223
|
-
]),
|
|
224
|
-
_: 3
|
|
225
|
-
})) : (openBlock(), createBlock(Transition, {
|
|
226
|
-
key: 1,
|
|
227
|
-
name: "opecity"
|
|
228
|
-
}, {
|
|
221
|
+
createVNode(Transition, { name: "opecity" }, {
|
|
229
222
|
default: withCtx(() => [
|
|
230
223
|
withDirectives((openBlock(), createElementBlock("div", {
|
|
231
224
|
ref_key: "pop",
|
|
232
225
|
ref: pop,
|
|
233
|
-
class: normalizeClass(["tdd-absolute tdd-z-1000 tdd-rounded tdd-bg-white tdd-p-4 tdd-drop-shadow", [marginClass.value, _ctx.insertClass]]),
|
|
226
|
+
class: normalizeClass(["tdd-absolute tdd-z-1000 tdd-rounded tdd-bg-white tdd-p-4 tdd-drop-shadow tdd-border tdd-border-gray-300 tdd-box-border", [marginClass.value, _ctx.insertClass]]),
|
|
234
227
|
style: normalizeStyle({ width: widthNum.value, top: `${Top.value}px`, left: `${Left.value}px` })
|
|
235
228
|
}, [
|
|
236
229
|
renderSlot(_ctx.$slots, "default"),
|
|
@@ -241,8 +234,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
241
234
|
])
|
|
242
235
|
]),
|
|
243
236
|
_: 3
|
|
244
|
-
})
|
|
245
|
-
], 8, ["disabled"]))
|
|
237
|
+
})
|
|
238
|
+
], 8, ["to", "disabled"]))
|
|
246
239
|
], 40, _hoisted_1);
|
|
247
240
|
};
|
|
248
241
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, onMounted, nextTick, onUnmounted, renderSlot, createVNode } from "vue";
|
|
2
|
-
import { o as on, a as off, b as getScrollWidth,
|
|
2
|
+
import { o as on, a as off, b as getScrollWidth, e as addResizeListener, r as removeResizeListener } from "../index/index.js";
|
|
3
3
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "movebar",
|
|
5
5
|
props: {
|